glMatrixMode(GL_PROJECTION);\r
glLoadIdentity();\r
\r
- float aspect = (float)height / (float)width;\r
- if ( width > height ) aspect = (float)width / (float)height;\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
glPushMatrix();\r
glTranslatef(0.0, 0.5, 0.0); // **NOTE: Teapot currently does not rest on surface\r
glColor3f(0.0, 0.0, 0.0);\r
+ glFrontFace(GL_CW);\r
glutSolidTeapot(1);\r
+ glFrontFace(GL_CCW);\r
glPopMatrix();\r
\r
// Draw a white ball over the light source\r
\r
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, glightmodel);\r
\r
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient);\r
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);\r
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular);\r
- glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emission0);\r
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shine);\r
+ glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);\r
+ glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);\r
+ glMaterialfv(GL_FRONT, GL_SPECULAR, specular);\r
+ glMaterialfv(GL_FRONT, GL_EMISSION, emission0);\r
+ glMaterialf(GL_FRONT, GL_SHININESS, shine);\r
\r
glEnable(GL_LIGHT0);\r
glEnable(GL_LIGHTING);\r
glDepthRange(0,1);\r
glEnable(GL_DEPTH_TEST); // Enables Depth Testing\r
glDepthFunc(GL_LEQUAL); // the type\r
- glEnable(GL_CULL_FACE);\r
glEnable(GL_TEXTURE_2D);\r
- glLineWidth(1.0);\r
+ glEnable(GL_CULL_FACE);\r
+ glEnable(GL_NORMALIZE);\r
+ glLineWidth(2.0);\r
\r
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);\r
\r