Skip to content

Instantly share code, notes, and snippets.

@sketchpunk
Created September 3, 2018 14:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sketchpunk/778c8aa561ca62142beecf849ad2cd57 to your computer and use it in GitHub Desktop.
Save sketchpunk/778c8aa561ca62142beecf849ad2cd57 to your computer and use it in GitHub Desktop.
Quaternion Vector Rotation in GLSL
vec3 vecQuatRotation(vec4 q, vec3 v){
return v + cross(2.0 * q.xyz, cross(q.xyz, v) + q.w * v);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment