(no commit message)
[atyndall/cits2231.git] / scene.c
diff --git a/scene.c b/scene.c
index 4852c0b..997d8b0 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -308,6 +308,9 @@ void motion(int x, int y) {
         // w: left/right, h: near/far\r
          //so.x, so.y, so.z\r
         //sceneObjs[curObject].x += (x - startx)*leftrightFactor;\r
+        printf("cam angle: %f\n", rotate*rotateFactor);\r
+        sceneObjs[curObject].x += (x - startx) * sin(90 - rotate*rotateFactor);\r
+        sceneObjs[curObject].z += (x - startx) * cos(90 - rotate*rotateFactor);\r
       } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {\r
         // w: big/small\r
         float diff = (x - startx);\r
@@ -375,7 +378,7 @@ void display() {
     0.0,  10.0,  0.0   /* up is in postivie Y direction */\r
     );\r
 \r
-  //glRotatef(camAngle*camAngleFactor, 1.0, 0.0, 0.0);\r
+  glRotatef(camAngle*camAngleFactor, 1.0, 0.0, 0.0); // Set camera angle upward\r
 \r
   /* Reposition the light source 0. */\r
   lightPosition0[0] = 12*cos(lightAngle0);\r

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