- (void)gluPerspective:(double)fovy :(double)aspect :(double)zNear :(double)zFar
{
// Start in projection mode.
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
double xmin, xmax, ymin, ymax;
ymax = zNear * tan(fovy * M_PI / 360.0);
ymin = -ymax;
xmin = ymin * aspect;
xmax = ymax * aspect;
glFrustumf(xmin, xmax, ymin, ymax, zNear, zFar);
}
Seems silly to not have this, given how short it is.
No comments:
Post a Comment