Hi.
I just wanted to know if gluPerspective does something like the following code (written in c):


void gluPerspective(double fovy, double faspect, double near, double far)
{
double xmin, ymin, xmax, ymax;

ymax = near * tan(fovy * PI / 360.0);
ymin = -ymax;
xmin = ymin * faspect;
xmax = ymax * faspect;

glFrustum(xmin, xmax, ymin, ymax, near, far);
}
Posted on 2002-03-09 07:38:19 by darester
Your implementation is correct.

The best way of knowing how any OpenGL function works is downloading mesa sourcecode and read it, there you can see how a realworld implementation of openGL works.

http://mesa3d.sourceforge.net
Posted on 2002-03-14 09:33:58 by dxantos