View Full Version : Camera Question

05-02-2002, 10: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.

05-02-2002, 11:44 AM

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.

05-02-2002, 12:21 PM
Use the force Luke!!!

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

05-02-2002, 12:55 PM