(no commit message)
[atyndall/cits2231.git] / scene.c
diff --git a/scene.c b/scene.c
index fff3726..e42c48c 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -123,8 +123,8 @@ GLfloat angle = -150;   /* in degrees */
 GLfloat angle2 = 30;   /* in degrees */\r
 \r
 /* Near and far parameters */\r
-GLfloat near = -10;\r
-GLfloat far = 10;\r
+GLfloat near = -100;\r
+GLfloat far = 100;\r
 \r
 /* Zoom factor for mouse movements */\r
 GLfloat zoomFactor = 1.0;\r
@@ -140,7 +140,8 @@ GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0};
 GLfloat ambient0[] = {0.0, 0.0, 0.0, 1.0};\r
 GLfloat specular0[] = {1.0, 1.0, 1.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 light0_pos[] ={1.0, 1.0, 0,0, 1.0};\r
+GLfloat glightmodel[] = {0.2,0.2,0.2,1};\r
 \r
 \r
 /**\r
@@ -664,8 +665,9 @@ void display() {
     \r
     // Draw teapot for a test object\r
     glPushMatrix();\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
     glPopMatrix();\r
 \r
     // Draw a white ball over the light source\r
@@ -692,21 +694,24 @@ void init() {
   gluPerspective(\r
     60.0,  /* field of view in degree */\r
      1.0,  /* aspect ratio */\r
-    near,  /* Z near */\r
-     far   /* Z far */\r
+    -10,  /* Z near */\r
+     10   /* Z far */\r
     );    \r
 \r
-  glEnable(GL_LIGHT0);\r
+  \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
+  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, glightmodel);\r
+  glEnable(GL_LIGHT0);\r
+  glEnable(GL_LIGHTING);\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
-  glEnable(GL_COLOR_MATERIAL);\r
 \r
-  glEnable(GL_LIGHTING);\r
+  \r
 \r
   glMatrixMode(GL_MODELVIEW);\r
   glLoadIdentity();\r

UCC git Repository :: git.ucc.asn.au