View Full Version : Which are the frustrum's dimensions?

10-22-2009, 07:04 AM

I'm a newbie and I wanna have a deep understanding about OpenGL.

I'm trying to understand how the Field Of View affect the projection but I can't understand it; all I see when I change it is the effect of the zoom in the whole model; also I need to do a little complex algorithms that involve it and I can't do it because I don't understand how it works.

So I think I can understand it if you can answer this questions:

* Once we establish the projection using gluPerspective() how can I get the frustrum's dimensions? I mean its height, and the with and height of the nearest and farthest plane.

* What's the formula to create the frustrum when we use gluPerspective() ?


Ilian Dinev
10-22-2009, 07:36 AM
This formula answers all your questions:

Construct a cube [-1;1], multiply its vertices by the inverse of the projection-matrix (or view-projection matrix): the distorted cube now fits the frustum perfectly.

Dark Photon
10-22-2009, 01:04 PM
And for a spiffy little labeled diagram of what you're doing, see this:

* http://www.songho.ca/opengl/gl_transform.html

Search down for "projection matrix".