Rotating the camers


I want to know what How to rotate a whole scene using the camera in opengl
What I mean is moving the camera around the scene to see it from different direction ( left, right , front, back) using left/right arrows for example .

What is the concept or the idea to do that ?

Thanks to any help .

OpenGL has no specific “camera”.
The viewer is always in the eye coordinate origin (0,0,0).
Camera position and orientation manipulation is done with the modelview matrix.
Apply the desired camera manipulation inversely to the whole world. Like strafe left with the viewer is the same as translating the world to the right.
Mind the ordering of rotations! It’s worth to look at quaternions for 6-degrees of freedom movement.
Be careful about the handedness of your camera implementation, cameras normally use a left handed system looking down the positive z-axis. But OpenGL model and world coordinate systems are right handed.

[This message has been edited by Relic (edited 01-08-2004).]

Thanks Relic …

The Red Book (The OpenGL Programming Guide has a good intruduction to modelling and viewing transformations. An online version is available at
(That’s the index, you’ll also find the Reference Manual as well). Chapter three of the programming guide holds the introduction.