Archived

This topic is now archived and is closed to further replies.

Question: glFrustrum vs glPerspective

This topic is 5746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m reading the red and blue books, and am trying to understand the difference between these two functions. Actually, I''m trying to understand glFrustrum. How can it know the angle of your frustrum if you''re trying to create a projection? It only asks for top, bottom, left, right, front, back doubles. Thanks for your time, Mal the confused.

Share this post


Link to post
Share on other sites
To satisfy my own personal curiosity, I''m trying to find some information on glFrustrum. I can''t seem to figure out how to use it, without using gluPerspective.

Any help would be appreciated.

Thanks.

Mal the less confused.

Share this post


Link to post
Share on other sites
glFrustum is more general than gluPerspective.
As zedzek said, it''s only shortcut to the glFrustum

double left, right;
double bottom, top;
double zfar, znear;

top = tan (FOV*3.14159/360.0)*NEARPLANE;
bottom = -top;
left = ASPECT*bottom;
right = ASPECT*top;

glFrustum (left, right, bottom, top, NEARPLANE, FARPLANE);

this corresponds call:

gluPerspective (FOV, ASPECT, NEARPLANE, FARPLANE);

wasn''t that hard.

Share this post


Link to post
Share on other sites