Would someone who understands 3d graphics give me a rundown of the API in Quaternion.h? In particular, I don’t understand what rotateUnit{X,Y,Z} do.
My understanding of a Quaternion is that it represents a rotation - three of the numbers represent a vector, while the fourth number represents the angle we rotate around that vector. Is that accurate? Is there anything else they’re used for? Couldn’t we also represent any rotation with just three angles, representing rotation around the x/y/z axes?
Going by what's familiar to me, it looks like the matrix
[rotateUnitX() ; rotateUnitY() ; rotateUnitZ()]
is the rotation matrix corresponding to the quaternion's rotation. Thus, the vector rotateUnitX() is the unit X vector in the global frame expressed in the rotated frame described by the quaternion.
In other words, it's equal to the (quaternion, as a rotation) multiplication of the quaternion by the global unit X vector [1 0 0].
3
u/lord_braleigh Nov 26 '20
Would someone who understands 3d graphics give me a rundown of the API in Quaternion.h? In particular, I don’t understand what
rotateUnit{X,Y,Z}do.My understanding of a Quaternion is that it represents a rotation - three of the numbers represent a vector, while the fourth number represents the angle we rotate around that vector. Is that accurate? Is there anything else they’re used for? Couldn’t we also represent any rotation with just three angles, representing rotation around the x/y/z axes?