PDA

View Full Version : detect current position



11-16-2000, 07:02 PM
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...

DPalomo
11-17-2000, 02:50 AM
Originally posted by miey:
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...

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