Comments and answers for "Quaternion Rotation Order and Axis"
http://answers.unity.com/questions/47362/quaternion-rotation-order-and-axis.html
The latest comments and answers for the question "Quaternion Rotation Order and Axis"Comment by Advokate on Advokate's answer
http://answers.unity.com/comments/100752/view.html
Thank you! This really helps clear things up for meSun, 13 Feb 2011 19:02:50 GMTAdvokateComment by Jesse Anders on Jesse Anders's answer
http://answers.unity.com/comments/100715/view.html
The documentation, alas, is not always correct :) Some math libraries do swap quaternion multiplication order around in order to match the vector notation convention used, but I'm 99% sure (I'd have to check to be 100% sure) that Unity uses standard quaternion multiplication order, which means that the quaternion product p*q rotates by q and then by p.Sun, 13 Feb 2011 12:48:06 GMTJesse AndersComment by Advokate on Advokate's answer
http://answers.unity.com/comments/100709/view.html
Yes, switching it around gives the behavior which I expect. However, the unity documentation here: http://unity3d.com/support/documentation/ScriptReference/Quaternion-operator_multiply.html
implies that a quaternion operation of:
lhs*rhs is equivalent to rotating by lhs first and then rhs rather than the other way round.Sun, 13 Feb 2011 10:57:16 GMTAdvokateComment by Jesse Anders on Jesse Anders's answer
http://answers.unity.com/comments/100708/view.html
The quaternion multiplication order should be the same as the matrix multiplication order in this case, so instead of 'rotateY*rotateX', you'll want 'rotateX*rotateY'. (The Unity math library uses column vectors and 'standard' quaternion multiplication order, which means that the multiplication order should be the same for both quaternions and matrices.)Sun, 13 Feb 2011 10:42:46 GMTJesse AndersComment by Advokate on Advokate's answer
http://answers.unity.com/comments/100707/view.html
Thanks for the response, I did some further exploring in code and updated my question.Sun, 13 Feb 2011 10:18:17 GMTAdvokateAnswer by Jesse Anders
http://answers.unity.com/answers/47374/view.html
<p>Firstly, what you describe doesn't have anything specifically to do with quaternions; it's just how rotations behave, and will be the same whether you use quaternions or (e.g.) matrices.</p>
<p>What you're seeing is how Euler-angle rotations work. Each rotation in the sequence modifies the coordinate basis (in general), meaning, for example, that the first rotation in the sequence will generally appear to occur about one of the object's local axes rather than a global axis.</p>
<p>If this isn't the desired behavior, you can instead modify the orientation incrementally from update to update (rather than building it 'from scratch' as in your example).</p>Sun, 13 Feb 2011 07:56:15 GMTJesse Anders