# Why does rotating an object on its axes in a different order result in a different final rotation?

As in the first GIF below, the result of rotating X first and Y rotating is different from rotating Y first and rotating X.

And like the second GIF, the result of rotating the Z of two objects first, then rotating X first, then rotating Y, and rotating Y first and rotating X are different.

Obviously, although the X, Y, and Z values ​​of the object are the same, what causes the rotation result to be different depending on the rotation order? Is there a workaround?

• What causes the result to be different? The different order causes it. By changing the order, you put the object at a different orientation when beginning the next axis rotation in the current rotation order. So naturally the result would be different. Is there a workaround? Yes. It's called Quaternions. – R-800 Jun 24 at 6:29
• Try it with thee coffee-mug on your desk. (Make sure it's empty, first) :D – Robin Betts Jun 24 at 7:34
• So the problem you're talking about is that my method shown above is a way to cause gimbal lock? I have heard of the gimbal lock problem. So, when I rotate the object like the above method, I set it as a Quaternions. However, after heard your answer now i think that I didn't understand how to use the Quaternions correctly. – upyen Jun 24 at 9:00
• Rotations are not commutative. ie the order matters. (A * B != B * A) It's not gimbal lock which is due to "locking of a gimbal" at 90 degree rotations. – batFINGER Jun 25 at 13:11