View Full Version : How does one change field of view in OpenGL
08-12-2005, 11:50 AM
I am rendering a large scene. By default the rendered view is a very small portion of the overall scene.
It is very straightforward to change camera position and perspective. But I have not found a way to "zoom the camera out" so that it sees a much larger portion of the scene.
What are the ways (opengl function calls) in which I might "zoom out"?
08-12-2005, 11:53 AM
By the way I use gluLookAt to set the camera view.
Other than playing with the fov in gluPerspective or fiddling with glFrustum, try creating a "dolly" for your camera, so you can roll it back along the view vector. This is amounts to a simple translation along the view vector (view = normalize(center - eye)).
For ortho views, look at glScalef or playing with the parameters to glOrtho. To keep things symmetrical, scale from the center of projection.
08-12-2005, 05:15 PM
One important thing to know is that the glFrustum or gluPerspective calls are made on the projection matrix, not the modelview matrix where you use your gluLookat call, so bear that in mind.
glMatrixMode switches which matrix you are manipulating.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.