\r
/* Light 0 parameters */\r
GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0};\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 ambient0[] = {0.0, 0.0, 0.0, 1.0};\r
GLfloat specular0[] = {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
+GLfloat emission0[] = {0.0, 0.0, 0.0, 0.0};\r
+GLfloat light0_pos[] ={1.0, 1.0, 0,0, 1.0};\r
+GLfloat glightmodel[] = {0.2,0.2,0.2,1};\r
*/\r
void windowReshape(int w, int h) {\r
glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
*/\r
void windowReshape(int w, int h) {\r
glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
glLoadIdentity();\r
if (w <= h) \r
glOrtho(near, far, near*(GLfloat)h/(GLfloat)w,\r
glLoadIdentity();\r
if (w <= h) \r
glOrtho(near, far, near*(GLfloat)h/(GLfloat)w,\r
glOrtho(near*(GLfloat)w/(GLfloat)h,\r
far*(GLfloat)w/(GLfloat)h, near, far, near, far);\r
glMatrixMode(GL_MODELVIEW); \r
glOrtho(near*(GLfloat)w/(GLfloat)h,\r
far*(GLfloat)w/(GLfloat)h, near, far, near, far);\r
glMatrixMode(GL_MODELVIEW); \r
glDisable(GL_TEXTURE_2D);\r
glEnable(GL_BLEND);\r
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\r
glColor4ub( 0.0, 0.0, 0.0, 0.5 );\r
\r
glBegin(GL_LINES);\r
glDisable(GL_TEXTURE_2D);\r
glEnable(GL_BLEND);\r
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\r
glColor4ub( 0.0, 0.0, 0.0, 0.5 );\r
\r
glBegin(GL_LINES);\r
- glVertex3i( 10.0, 0.1, 0.0);\r
- glVertex3i( -10.0, 0.1, 0.0);\r
+ glVertex3i( 10.0, 0.1, 10.0);\r
+ glVertex3i( -10.0, 0.1, -10.0);\r
- 0.0, 0.0, 10.0, /* eye is at (x,y,z) */\r
+ 0.0, 10.0, 10.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
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
// **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
// **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
- glTranslatef(0.0, 1.0, 0.0); // **NOTE: Teapot does not rest on surface\r
- glutWireTeapot(1);\r
+ glTranslatef(0.0, 0.5, 0.0); // **NOTE: Teapot does not rest on surface\r
+ glColor3f(0.5, 0.5, 0.5);\r
+ glutSolidTeapot(1);\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
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_COLOR_MATERIAL);\r
+ glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );\r
+ glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, specular0);\r
+ glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, emission0);\r
+\r
+ \r