How does quat work with respect to normal rotations?

Hi guys,

Would anyone be able to explain how quat works with respect to Blender
Bones? For example, if I initially have a bone whose head is at (1, 1, 1)
and whose tail is at (2, 3, 4). If I then want to rotate this bone around
the Z axis for 45 degrees, then around the X axis for 30 degrees, then
around the Y axis for 60 degrees, what would the quat representation
of these rotations look like? I read the documentation that the quat
is in the format of (w, x, y, z). What does w stand for? How is x, y, z
related to the angle of the desired rotation?

Say if I have the resting matrix of the bone as M1, then I create 3 more
matrices: Mz, Mx, and Mz that correspond to above three rotations of the
bone. Would the following operation give me the quat?

(M1 * Mz * Mx * Mz * M1^-1).toQuat()

Thanks a lot.

a quarternoin isn’t useful to humans, the x y z w values don’t really mean anything on their own.

yes, multiplying the matricies then converting to quat should work

quarternoins are preferred over euler angles because the interpolation is better and there is no gymbol lock. They are easier to interpolate than rotation matricies, and also take less memory.

if you have a gamasutra login, here’s an article that introduces them

Thanks a lot zerod!! Your comments are really helpful!!

Have a nice day.