(no commit message)
authorAsh Tyndall <[email protected]>
Sat, 22 Oct 2011 03:30:09 +0000 (11:30 +0800)
committerAsh Tyndall <[email protected]>
Sat, 22 Oct 2011 03:30:09 +0000 (11:30 +0800)
globals.c
scene.c

index c79395a..7b1a4a1 100644 (file)
--- a/globals.c
+++ b/globals.c
@@ -92,7 +92,7 @@ GLfloat emission[] = {0.0, 0.3, 0.3, 1.0};
 /* Zoom and rotate tracking */
 GLfloat zoom = 0.0, rotate = 0.0, camAngle = 40.0;
 GLfloat zoomFactor = 0.2, camRotateFactor = 0.5, camAngleFactor = 0.5;
-GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.6, updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.5;
+GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.6, updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.05;
 
 /* Beginning width, height */
 int width = 500, height = 500;
diff --git a/scene.c b/scene.c
index a0fbff1..b02b4f1 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -306,7 +306,7 @@ void motion(int x, int y) {
       if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
         // w: left/right, h: near/far\r
 \r
-        // **NOTE: Currently a work in progress\r
+        // **NOTE: Currently a work in progress, does not work correctly\r
         printf("cam angle: %f\n", rotate*camRotateFactor);\r
         sceneObjs[curObject].x += diffx * sin(rotate*camRotateFactor);\r
         sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor);\r
@@ -327,19 +327,25 @@ void motion(int x, int y) {
       break;\r
 \r
     case STATE_OBJECT_ROTATION_TEXTURE_SCALE:\r
+\r
       if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
         // w: rotate on y\r
         sceneObjs[curObject].rotation.y += diffx * rotateFactor;\r
+\r
         // h: rotate on x\r
         sceneObjs[curObject].rotation.x += diffy * rotateFactor;\r
+\r
       } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {\r
         // w: rotate on x\r
         sceneObjs[curObject].rotation.x += diffx * rotateFactor;\r
+\r
         // h: texture scale\r
         float max = (float)height/texscaleFactor;\r
         float scaling = (diffy + max) / max;\r
         sceneObjs[curObject].texture.scale *= scaling;\r
+\r
       }\r
+      \r
       break;\r
 \r
   }\r

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