int floorSize = 200;
/* Current camera x, y, z coords */
-GLfloat camx = 0.0, camy = 0.0, camz = 0.0;
+GLfloat camx = 0.0, camy = 0.0, camz = 0.0, rot = 0.0;
/* Light 0 parameters */
GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0};
extern int floorSize;
/* Current camera position */
-extern GLfloat camx, camy, camz;
+extern GLfloat camx, camy, camz, rot;
/* Light 0 parameters */
extern GLfloat diffuse0[];
case 'e':\r
camy = camy - 1;\r
break;\r
+ case 'z':\r
+ rot = rot + 1;\r
+ break;\r
+ case 'x':\r
+ rot = rot - 1;\r
+ break;\r
}\r
- printf("Camera is now at (%f, %f, %f)\n", camx, camy, camz);\r
+ printf("Camera is now at (%f, %f, %f), angle %f\n", camx, camy, camz, rot);\r
glutPostRedisplay();\r
}\r
\r
\r
// **NOTE: Currently this rotation function is all that moves the camera off\r
// the flat surface. Need to integrate function into gluLookAt\r
- //glRotatef(30.0, 1.0, 0.0, 0.0);\r
+ glRotatef(rot, 1.0, 0.0, 0.0);\r
\r
/* Reposition the light source. */\r
lightPosition[0] = 12*cos(lightAngle);\r