Get pitch/yaw/roll from a rotation matrix

Blitz3D Forums/Blitz3D Programming/Get pitch/yaw/roll from a rotation matrix

bytecode77(Posted 2009) [#1]
hi!

it is easy to get the position of a position-only-matrix. the same applies for the scale matrix, but what about the rotation matrix?

i have a matrix storing only the rotation and need a function that gets the pitch/yaw/roll from this matrix?

any math specialists here?
thank you :)


Gabriel(Posted 2009) [#2]
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm


bytecode77(Posted 2009) [#3]
thats not workign for me. i allways get zero for pitch, yaw and roll.


Difference(Posted 2009) [#4]
My version of the code from that site below.
It gives quite good results, but I don't think they are 100% correct.

You will at least have to experiment with the signs for the rotations to get it correct.

I'm also not sure what to do with the determinant, so if you can help out it will be much appreciated.

I have the same question here: /Community/posts.php?topic=82644#932186




bytecode77(Posted 2009) [#5]
		heading = ATan2(-rm.c1,rm.a1)
		bank = ATan2(-rm.b3,rm.b2)
		attitude = ASin(rm.b1)
thats the code i'm using. i dont get it - after looking closer to the results, i found that the results are between zero and two.

EDIT: i think it starts working after i multiplied with 180.0/PI
thanks guys :)