Disclaimer: I am a professional games programmer, and use quaternions most days but they are close to black magic to me. I am relatively at home with math but imaginary numbers always confused me. I tend to treat quats as useful and end up reversing multiplications more than once. I try to reason about them like I would with matrices with limited success.
Anyhow....
What baffles me, is the following. When I want to rotate an object around it's local axis I multiply its rotation with the quaternion that represents the rotation I want to apply. It is therefore a rotation in local space.
Now if I want to rotate it around an axis in world space, my reasoning would be: Take the rotation in world space as a quaternion. Multiply the inverse of my object rotation with this quaternion. This will bring my world rotation in local space. Multiply my rotation with this new quaternion. ie: newRot = oldRot * (inverse oldRot * worldRot)
However, what I need to do is newRot = oldRot * (inverse oldRot * worldRot) * oldRot.
Why do I, after multiplying with the inverse quat still need to multiply with my own quat before applying it? I know there must be a perfect valid reason, but I can't reason my way out of it and it's frustrating as heck to me. I tried the various faqs and whatnot, but most go to deep in the math, making it less clear to me.
Anyone who can explain this to me like I'm a 5 year old?
I try to reason about them like I would with matrices
- then you are on the right track. If you understood how to rotate around object's axes and world's axes using matrices, you can do the same using quaternions. The multiplication order is the same for both, matrices and quaternions. \$\endgroup\$