Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Rotations

Started by disruptive 2 replies 950+ views
Original Post
disruptive
disruptive
There are a number of ways to produce rotations in 3D, using the Euler angles or Quaternion rotations. However I believe that both methods are non commutative. What I require to do is to rotate in 3D, however need to be very sure that the rotations are performed in such a way that I can can get back to the original position. Therefore what concerns me is the non-commutative nature of the rotations, for example a rotation in Euler angles is x' = BCDx, where x is the vector to be rotated. However, in going back, I need to invert the matrix BCD, which is fine. Or one can run in reverse with the negative angles of theta, phi and psi that are used in matricies B C and D. However, I want to know if there is any routine that would enable to get from x' back to x by using the same rotation matrix or machinery. My question is thus does the Quaternion behave in this way, i.e. I do not have to worry about the order of the operations? I really wish to be able, to clarify: to not have to worry about the rotation matrix orders. Thanks
flounder
flounder
Quote:

Or one can run in reverse with the negative angles of theta, phi and psi that are used in matricies B C and D.


cos(-a)=cos(a)
sin(-a)=-sin(a)

You should just have to flip the sign of all the sine values in your current rotation matrix to get the un-rotation matrix.
ma_hty
ma_hty
You are not going to find a rotation representation that can make rotation commute. It is simply the nature of rotation.

However, "using the same rotation matrix" for the inverse can be a trivial operation.

A rotation matrix is a orthonormal matrix. Therefore, the inverse of it is simply the transpose of it. Finding a transpose of a matrix is far easier than finding a inverse of a matrix.

And, the quaternion representation for rotation behave in similar way too. The inverse of a quaternion rotation is the conjugate of it.
ma_hty
ma_hty
Quote:
Original post by disruptive
Therefore what concerns me is the non-commutative nature of the rotations, for example a rotation in Euler angles is

x' = BCDx, where x is the vector to be rotated. However, in going back, I need to invert the matrix BCD, which is fine. Or one can run in reverse with the negative angles of theta, phi and psi that are used in matricies B C and D.


By the way, the inverse of BCD is not B(-theta)C(-phi)D(-psi). It should be D(-psi)C(-phi)B(-theta) instead.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.