View Full Version : Problem with projection/viewing for a game.

Anonymous Coward
02-17-2002, 12:31 PM
Suppose I want to make a 3D game, but the view is fixed down the -Y axis (imagine an Asteroids-like game). How should I set the projection and viewing transformation? I have tried to translate objects over the XZ plane and then move the camera in the Y axis and point it to (0,0,0) using gluLookAt(0,25,0,0,0,0,0,1,0). This seems right to me, the main problem is with the frustum, what should I do in order to calculate the frustum (remember, I want the view to be always the same, the objects are the ones that will move and change over time). Thanks in advance!!!

02-26-2002, 01:56 PM
First, if you are looking down the -Y axis, you should not set the UP vector to (0,1,0). Use (1,0,0) or (0,0,1) -- whichever is up on the screen.

If your display is 2D, then use an ortho projection. That way your "frustum" is actually a box whose x, y, and z values are constant.