Commits

Cliff Biffle  committed 44d0f46

W/S rotate the camera around X.

  • Participants
  • Parent commits 1e43181

Comments (0)

Files changed (2)

File KVDepthView.h

   BOOL usingTrackball;
   GLfloat trackballRotation[4];
   GLfloat worldRotation[4];
-  GLfloat spin;
+  GLfloat spinY, spinX;
     
   FILE *depthOutput;
   

File KVDepthView.m

     unichar character = [characters characterAtIndex:0];
 		switch (character) {
 			case 'a':
-				spin += 10;
+				spinY += 10;
 				[self setNeedsDisplay: YES];
 				break;
 			case 'd':
-				spin -= 10;
+				spinY -= 10;
+				[self setNeedsDisplay: YES];
+				break;
+			case 'w':
+				spinX += 10;
+				[self setNeedsDisplay: YES];
+				break;
+			case 's':
+				spinX -= 10;
 				[self setNeedsDisplay: YES];
 				break;
 		}
   
   glRotatef(trackballRotation[0], trackballRotation[1], trackballRotation[2], trackballRotation[3]);
   glRotatef(worldRotation[0], worldRotation[1], worldRotation[2], worldRotation[3]);
-  glRotatef(spin, 0, 1, 0);
+  glRotatef(spinY, 0, 1, 0);
+  glRotatef(spinX, 1, 0, 0);
   
   // Determined empirically.
   GLfloat xyAdj = 0.8F;