View Full Version : how can I get GL to return the current transformation?
09-27-2000, 02:59 PM
say I translated a whole bunch of times and lost track of all of it, but I needed to know what I was translated to. Is there a function that will tell me what the world is translated to, ex. -10,5,15?
mat now holds the current modelview matrix and mat mat mat = translational component x,y,z
09-30-2000, 04:58 PM
No that didn't work at all. All I want to do is save the camera position in 3d space, x y z. Remember, not any rotations, just transformation. The problem is I have no idea of what the position is.
so later I want to be able to reload this transformation. and stick the camera exactly where it was.
09-30-2000, 08:01 PM
been working on this problem for 3 months!!
10-01-2000, 02:18 AM
What he said earlier should work except for one thing, you want the projection matrix, not the modelview matrix.
10-03-2000, 05:30 AM
You don't need to "know" the last location of your camera because I think you can simply select your projection matrix with something like glMatrixMode(GL_PROJECTION) and then "push" the matrix onto the matrix stack. Then "pop" it off the stack later when you want to reload it. I'm pretty new to GL too so someone tell me if I'm totally without a clue here.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.