Commits

Cliff Biffle committed 44d0f46

W/S rotate the camera around X.

Comments (0)

Files changed (2)

   BOOL usingTrackball;
   GLfloat trackballRotation[4];
   GLfloat worldRotation[4];
-  GLfloat spin;
+  GLfloat spinY, spinX;
     
   FILE *depthOutput;
   
     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;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.