Which are the frustrum's dimensions?


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() ?


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.

And for a spiffy little labeled diagram of what you’re doing, see this:

Search down for “projection matrix”.