detect current position

i have a program where i can move around the scene using arrow keys. Now i need to detect the current position of x, y and z.

which means, everytime i move, the program will return the value of x, y and z.

anybody can help, pleaseeee…

Originally posted by miey:
[b]i have a program where i can move around the scene using arrow keys. Now i need to detect the current position of x, y and z.

which means, everytime i move, the program will return the value of x, y and z.

anybody can help, pleaseeee…[/b]

You could use the gluLookAt() function, passing the current position of the camera, instead of rotating your entire scene.
I’ve written a camera tutorial to do your own rotations/translations of the camera in OpenGL. You can find it at: http://www.liacs.nl/~dpalomo/camtut/camtut.html

Hope this helps,

Daniel Palomo van Es