In your example you can change the order of multiplications and it works the same way. Your arbitrarily assumed order left-to-right, but this is not cast into stone. Matrices are usually* applied right to left.
No I can't change the order, because quaternion-multiplications are not commutative. Nor are matrix-multiplications.
As I said previously, it is inconsistent. If you are right an matrix-multiplications are calculated from right-to-left, then the *-operator ist implemented wrong.
The implementation of the *=-operator makes no sense (maybe only to me) with the current implementatin of the *-operator:
Is implemented as
In words that means:
Rotate something (q1) by a specific rotation (q2) and store the result in the variable for something (q1) (presuming, that quaternion-multiplications are done from right-to-left).
That would be correct and what I want.
But it does not work. It rotates q2 by q1 and stores the result in q1.
Unfortunately the *-operator for quaternions does not work from right-to-left.
If I write
it works correct.
Well, I got that problem by using the *=-operator in my code. Because of that problem, I made some manual tests with numbers and it turned out, that the rotation is apllied in the wrong direction.
The only other possibility would be, that I messed up my code in several situations (Which is possible, of course
).
So long
Edit1: Doe! I think quaternions only work well in right-handed coord-systems. Is it possible, that they have to be transformed to work correctly in a left-handed-system?
If true then my quaternions would have the wrong direction for the rotation. That may exactly look like a wrong implementation of the *= and *-operators
Maybe it is just the cross-product for vectors, that is the problem.
Now I'm scared and confused :/