Commits

Cliff Biffle committed 8a801c1

Moved the depth array scaling and translation out of the inner computation loop and into the MODELVIEW matrix.

Comments (0)

Files changed (1)

   camera = (camera_t) {
     .aperture = 57,
     .pivot = { 0, 0, 0 },
-    .viewPos = { 0, 0, -10 },
+    .viewPos = { 0, 0, -7.5 },
     .viewDir = { 0, 0, 10 },
     .viewUp = { 0, 1, 0 },
   };
   
   glRotatef(trackballRotation[0], trackballRotation[1], trackballRotation[2], trackballRotation[3]);
   glRotatef(worldRotation[0], worldRotation[1], worldRotation[2], worldRotation[3]);
-  glTranslatef(3.2,2.4,0);
+  glScalef(-1/160., -1/160., 1);
+  glTranslatef(-320, -240, 0);
 }
 
 - (void) drawDepthField {
   glColor3f (1.0, 0.5, 0.0);
   for (int y = 0; y < 480; y++) {
     for (int x = 0; x < 640; x++) {
-      glVertex3f(-x/100., -y/100., sin(x*3.14159/180));
+      glVertex3f(x, y, sin(x*3.14159/180));
     }
   }
   glEnd();