Question

I have a 3d object which is free to rotate along x,y and z axis and it is then saved as a transform matrix. In a case where the sequence of rotation is not known and the object is rotated for more than 3 times (eg :-if i rotate the object x-60degress, y-30 degrees, z-45 degrees then again x->30 degrees), is it possible to extract the angles rotated from the transform matrix?.I know that it is possible to get angles if the sequence of rotation is known, but if I have only the final transform matrix with me and nothing else, is it possible to get the angles rotated(x,y,and z) from the transform matrix ?

Was it helpful?

Solution

Euler angle conversion is a pretty well known topic. Just normalize the matrix orientation vectors and then use something like this c source code.

The matrix is the current state of things it has no knowledge of what the transformation has been in the past. It does not know how the matrix was built. You can just take the matrix into and decompose it into any pieces you like, as long as:

  1. The data do not overlap. For example:Two X turns after each other is indistinguishable form each other (no way to know if its 1 2 or three different rotations summed).
  2. The sequence order is known
  3. A decomposition can be built out of the data (for example scale can be measured)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top