- glTranslatef(camx, camy, camz);\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(rot, 1.0, 0.0, 0.0);\r
+ float aspect;\r
+ if ( width <= height ) {\r
+ aspect = (float)height / (float)width;\r
+ } else {\r
+ aspect = (float)width / (float)height;\r
+ }\r
+\r
+ gluPerspective(\r
+ 75.0,\r
+ aspect,\r
+ 0.1,\r
+ 200\r
+ );\r
+\r
+ glMatrixMode(GL_MODELVIEW);\r
+ glLoadIdentity();\r
+\r
+ gluLookAt(\r
+ 0.0, 0.0, 5.0, /* eye is at (x,y,z) */\r
+ 0.0, 0.0, 0.0, /* center is at (x,y,z) */\r
+ 0.0, 1.0, 0.0 /* up is in postivie Y direction */\r
+ );\r
+\r
+ glRotatef(75.0, 1.0, 0.0, 0.0);\r