PDA

View Full Version : rotation matrix and glRotate()

Shweta
04-25-2005, 10:57 PM
hi all,
thanx for the prompt responses i received last time.
this time new problem.
given a 3d rotation matrix how do you find out what parameters were given
ex:
if i had the 3d rotation matrix
-0.001 1.00 -0.027
0.964 0.265 -0.036
-0.029 -0.026 -0.964
what was the value of :theta,x,y,z
in GlRotate i.e.
glRotatef(theta,x,y,z);
if the q is not clear to you,tell me and i shall give more explanation on it.

MMMovania
04-26-2005, 05:20 AM
Originally posted by Shweta:
hi all,
thanx for the prompt responses i received last time.
this time new problem.
given a 3d rotation matrix how do you find out what parameters were given
ex:
if i had the 3d rotation matrix
-0.001 1.00 -0.027
0.964 0.265 -0.036
-0.029 -0.026 -0.964
what was the value of :theta,x,y,z
in GlRotate i.e.
glRotatef(theta,x,y,z);
if the q is not clear to you,tell me and i shall give more explanation on it.I think you would have to use the inverse of the rotation matrices. Perhaps why don't you try it out on paper first using the rotation matrices that can be found in any grafix book. Use the quarternion matrix cos i think the glRotatef uses it.
Thanx
MMM

CrazyButcher
04-26-2005, 06:18 AM
lookup matrix decomposition, which is not that trivial to do, especially if your matrix has non uniform scaling and so on.

http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm

that site has a bunch of maths info btw