/* Size of floor, from -n to n */\r
int floorSize = 100;\r
\r
+/* Light 0 parameters */\r
+GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0};\r
+GLfloat ambient0[] = {1.0, 1.0, 1.0, 1.0};\r
+GLfloat specular0[] = {1.0, 1.0, 1.0, 1.0};\r
+GLfloat light0_pos[] ={ 1.0, 2.0, 3,0, 1.0};\r
+\r
+\r
/**\r
* Prints out error message when file cannot be read\r
* @param fileName Name of file that could not be read\r
\r
drawFloor();\r
\r
+ // Draw teapot for a test object\r
glPushMatrix();\r
- \r
- glTranslatef(0.0, 1.0, 0.0);\r
- glutWireTeapot(1); // Draw teapot for test\r
+ glTranslatef(0.0, 1.0, 0.0); // **NOTE: Teapot does not rest on surface\r
+ glutWireTeapot(1);\r
glPopMatrix();\r
\r
+ // Draw a white ball over the light source\r
glPushMatrix();\r
glDisable(GL_LIGHTING);\r
glColor3f(1.0, 1.0, 1.0);\r
-\r
- /* Draw a yellow ball at the light source. */\r
glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);\r
glutSolidSphere(1.0, 50, 50);\r
-\r
glEnable(GL_LIGHTING);\r
glPopMatrix();\r
\r
glLoadIdentity();\r
\r
gluPerspective(\r
- 60.0, /* field of view in degree */\r
- 1.0, /* aspect ratio */\r
- near, /* Z near */\r
+ 60.0, /* field of view in degree */\r
+ 1.0, /* aspect ratio */\r
+ near, /* Z near */\r
far /* Z far */\r
); \r
\r
-\r
-GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0};\r
-GLfloat ambient0[] = {1.0, 1.0, 1.0, 1.0};\r
-GLfloat specular0[] = {1.0, 1.0, 1.0, 1.0};\r
-GLfloat light0_pos[] ={ 1.0, 2.0, 3,0, 1.0};\r
-\r
-glEnable(GL_LIGHT0);\r
-glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);\r
-glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);\r
-glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);\r
-glLightfv(GL_LIGHT0, GL_SPECULAR, specular0);\r
+ glEnable(GL_LIGHT0);\r
+ glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);\r
+ glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);\r
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);\r
+ glLightfv(GL_LIGHT0, GL_SPECULAR, specular0);\r
glEnable(GL_LIGHTING);\r
\r
glMatrixMode(GL_MODELVIEW);\r
glutDisplayFunc(display);\r
glutMouseFunc(mouse);\r
glutMotionFunc(motion);\r
- //glutIdleFunc(idle);\r
\r
makeMenu();\r
\r