Rotation matrix in Blender

374 Views Asked by At

Rotation matrices are not commutative. I could not comprehend what is actually happening in Blender about such rotations. Initially my object is along z-axis. I am trying to rotate the object 45 degrees about x-axis first and subsequently 45 degrees by y-axis.

Now I am changing the rotation sequence (i.e. y-axis rotation by 45 degrees and later 45 degrees about x-axis), I end up resulting the same object rotation as in the previous case. enter image description here

Can someone explain what is happening here?

PS: I even tried rotations of x, y, and z-axis by 45 degrees each. Later changed the sequence to z, y, and x-axis by 45 degrees. I ended up getting same result among these 2 rotations.

1

There are 1 best solutions below

1
On BEST ANSWER

The rotation part of a transform in Blender (and many similar pieces of software) does not remember in what order you've changed the components. At any given point in time it just looks at what the components are, applies each of the axis rotations in a set order (decided ahead of time by whoever authored that particular part of Blender), and then displays the object in the resulting orientation.

Thus it doesn't matter whether you changed the $x$-rotation to $45^\circ$ first or the $y$-rotation to $45^\circ$ first. At the end, Blender sees they are both $45^\circ$, and applies the two rotations in the order it has been internally coded to apply them. That results in the orientation you see here.

I don't know which order the axes are coded to be applied, but here is a fun thing you can try (use a more asymmetrical object to see the effect more clearly): Find out which is applied second (through trial and error, for instance). Change that to some number. Now see what happens if you change either of the other two. One of them will make the object rotate about the corresponding global axis, while the other will make the object rotate about the corresponding local axis.

If you happen to set that second axis to $90^\circ$, then the two other axes from the above paragraph will coincide, and no matter which of the two other components you change the object will rotate the same way. You have lost a degree of freedom and entered what is commonly known as gimbal lock.

This actually demonstrates that which of the three axis rotations is applied first and which is applied third depends on whether you think about the rotations as being about the global coordinate axes or about the local axes of the object. However, the one that is applied second is applied second no matter which way you think about it.