PDA

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



Exoide
10-22-2009, 06:04 AM
Hi,

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


Thanks.

Ilian Dinev
10-22-2009, 06:36 AM
This formula answers all your questions:
http://www.opengl.org/sdk/docs/man/xhtml/gluPerspective.xml

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, 12: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".