(no commit message)
[atyndall/cits2231.git] / scene.c
diff --git a/scene.c b/scene.c
index c579335..aa3967b 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -10,6 +10,7 @@
 #include <math.h>\r
 #include <GL/gl.h>\r
 #include <GL/glut.h>\r
+#include <time.h>\r
 \r
 #include "bitmap.h"\r
 \r
@@ -483,8 +484,8 @@ void makeMenu() {
  * @param h New height\r
  */\r
 void windowReshape(int w, int h) {\r
-  GLdouble near = -10.0;\r
-  GLdouble far = 10.0;\r
+  GLdouble near = -1000.0;\r
+  GLdouble far = 1000.0;\r
 \r
   glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
   glMatrixMode(GL_PROJECTION);\r
@@ -508,7 +509,7 @@ void windowReshape(int w, int h) {
  */\r
 /*void mouse(int btn, int state, int x, int y) {\r
   \r
-}*/\r
+}*//*\r
 static void\r
 mouse(int button, int state, int x, int y)\r
 {\r
@@ -551,8 +552,15 @@ motion(int x, int y)
     lightStartY = y;\r
     glutPostRedisplay();\r
   }\r
-}\r
+}*/\r
 \r
+void idle() {\r
+  angle = (int)(angle + 10) % 360;\r
+    //angle2 = (int)(angle2 + 10) % 360;\r
+    printf("Angle 1: %f, Angle 2: %f\n", angle, angle2);\r
+    sleep(2);\r
+    glutPostRedisplay();\r
+}\r
 \r
 /**\r
  * Draw a floor.\r
@@ -614,7 +622,7 @@ void display() {
 \r
     glPushMatrix();\r
     \r
-      glTranslatef(0.0, 0.0, 0.0);\r
+      //glTranslatef(0.0, 0.0, 0.0);\r
       glutWireTeapot(30); // Draw teapot for test\r
     glPopMatrix();\r
 \r
@@ -642,10 +650,10 @@ void init() {
   glLoadIdentity();\r
 \r
   gluPerspective(\r
-     60.0,  /* field of view in degree */\r
-      1.0,  /* aspect ratio */ \r
-      0.0,  /* Z near */\r
-    900.0   /* Z far */\r
+       60.0,  /* field of view in degree */\r
+        1.0,  /* aspect ratio */\r
+    -1000.0,  /* Z near */\r
+     1000.0   /* Z far */\r
     );    \r
 \r
   glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);\r
@@ -697,8 +705,9 @@ int main(int argc, char **argv) {
 \r
   glutReshapeFunc(windowReshape);\r
   glutDisplayFunc(display);\r
-  glutMouseFunc(mouse);\r
-  glutMotionFunc(motion);\r
+  //glutMouseFunc(mouse);\r
+  //glutMotionFunc(motion);\r
+  glutIdleFunc(idle);\r
 \r
   makeMenu();\r
 \r

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