Question: glFrustrum vs glPerspective
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.
gluperspective calls glfrustum (its just an easier method to set up the viewing frustum)
http://uk.geocities.com/sloppyturds/gotterdammerung.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
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.
Any help would be appreciated.
Thanks.
Mal the less confused.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement