Commits

Cliff Biffle committed 33d71dc

Switched to gluPerspective from glFrustum. Code is simpler now.

Comments (0)

Files changed (1)

   }
 }
 
-#define SHAPE_SIZE (7.0F)
+#define SHAPE_SIZE (8.0F)
 
 - (void) updateProjection {
   [[self openGLContext] makeCurrentContext];
   GLdouble far = -camera.viewPos.z + SHAPE_SIZE * 0.5;
   if (far < 1.0) far = 1.0;
   
-  GLdouble halfApertureRadians = 0.0174532925 * camera.aperture / 2;
-  GLdouble wd2 = near * tan(halfApertureRadians);
-  
   GLdouble aspectRatio = camera.viewWidth / (GLdouble) camera.viewHeight;
-  GLdouble left, top;
-  if (aspectRatio > 1.0) {  // landscape
-    left = -aspectRatio * wd2;
-    top = wd2;
-  } else {  // portrait
-    left = -wd2;
-    top = wd2 / aspectRatio;
-  }
-  glFrustum(left, -left, -top, top, near, far);
+
+  gluPerspective(camera.aperture/aspectRatio, aspectRatio, near, far);
 }
 
 - (void) updateModelView {