3d rotation
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.
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.
No, you have to invert the matrix yourself.
gluUnproject does it...
gluUnproject does it...
well if you want to do it the hard way, you could always do the change of bases yourself with a little linear algebra.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Quaternion rotation -> OpenGL rotation matrix? | DJBlufire | 3 | 4,073 |
Sep 6, 2003 08:34 PM Last Post: MattDiamond |