PDA

View Full Version : 3d rotation


honkFactory
2003.03.19, 05:08 AM
Howdy,
I have a 3d rotation question. First, lets say you have an openGL view that looks straight down a the z axis when untransform - the normal setup. (Not an ortho view, a normal perspective.) Now, lets say the model matrix undergoes a series of rotation only transforms. Using the getfloat() method you can get the transformed model matrix. Now (here is the actual question, fianlly) how do you determine what vectors in the tranformed coordinate system are equal to the x, y or z vectors in the untransformed coordinate system? Do you do multiply say x (1,0,0) by the inverse (or the transpose) of the transform matrix? Can you get openGL to give you the inverse of the model matrix?
A.W.

[edit] I gues there is no reason to expect openGl be able to give the inverse, seeing as it is not a math library.

OneSadCookie
2003.03.19, 05:46 AM
No, you have to invert the matrix yourself.

gluUnproject does it...

kelvin
2003.03.19, 08:38 AM
well if you want to do it the hard way, you could always do the change of bases yourself with a little linear algebra.