PDA

View Full Version : camera position



frogger
09-14-2000, 01:30 PM
First, I know that the camera (as if there is one) is always at 0,0,0 and that we move the objects in a scene, but

after a series of translate rotates etc how can I get my camera's exact position wrt the world

grady
09-14-2000, 07:02 PM
I'm new so this might sound crazy. but if you mean that your modelview matrix and your projection matrix need to be equal to each other you can say

float yourMatrix[16];
glGetFloatv(GL_MODELVIEW_MATRIX, yourMatrix);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(yourMatrix);

I think this is what you are talking about, it might not even work though http://www.opengl.org/discussion_boards/ubb/frown.gif. Hope it helps.

grady
09-14-2000, 07:03 PM
wait a second, thats nonsense. nevermind, don't listen to me!

Relic
09-15-2000, 05:13 AM
Get the modelview matrix, invert it, and throw (0,0,0,1) at it.
Matrix inversion routines are to be found in these forums (forae?). Search for my name.

grady
09-15-2000, 09:20 AM
(straying from the subject by a mile)i think forum is neuter gender so if i remeber my latin from high school correctly the plural is "fora".

grady
09-15-2000, 09:22 AM
as if ya'll care. http://www.opengl.org/discussion_boards/ubb/rolleyes.gif