PDA

View Full Version : Camera Question



05-02-2002, 09:53 AM
I have a top view game. What camera view do I use so that when my player moves, the camera wil follow it?? Thanks.

Robbo
05-02-2002, 10:44 AM
Hi,


A rather ambiguous question. OpenGL doesn't have `cameras' - they are the product of the way you setup the modelview matrix. If you want to move the `view' with the player, you should translate the entire scene to the players co-ordinates. This should be the first transform on the stack at the start of each frame. With a purely top-down view, you can achieve this with glTranslatef (-playerX, -HEIGHT_ABOVE_PLAYER, -playerZ. ).

Hope this helps.

Nothing
05-02-2002, 11:21 AM
Use the force Luke!!!

*SCNR* http://www.opengl.org/discussion_boards/ubb/smile.gif

05-02-2002, 11:55 AM
ThAnx