Cameras and OpenGL
[Wavepacket Glut Library Wrapper]

Basically, use GL_PROJECTION to set up the camera properties but NOT position or rotation. More...

Collaboration diagram for Cameras and OpenGL:

Basically, use GL_PROJECTION to set up the camera properties but NOT position or rotation.

Use GL_MODELVIEW for those transformations.


From http://www.opengl.org/resources/faq/technical/viewing.htm :

The GL_PROJECTION matrix should contain only the projection transformation calls it needs to transform eye space coordinates into clip coordinates.

The GL_MODELVIEW matrix, as its name implies, should contain modeling and viewing transformations, which transform object space coordinates into eye space coordinates. Remember to place the camera transformations on the GL_MODELVIEW matrix and never on the GL_PROJECTION matrix.

Think of the projection matrix as describing the attributes of your camera, such as field of view, focal length, fish eye lens, etc. Think of the ModelView matrix as where you stand with the camera and the direction you point it.


From http://sjbaker.org/steve/omniv/projection_abuse.html :

One of the most common OpenGL programming errors is misuse of the GL_PROJECTION matrix stack. This matrix stack is often perceived as being the correct place to put the position and orientation of the 'camera' - but this is not in fact the case...

The Golden Rule. The rule is:

The only functions that should be called when the glMatrixMode is set to GL_PROJECTION are: