(no commit message)
authorAsh Tyndall <git@atyndall.net>
Sat, 22 Oct 2011 06:03:28 +0000 (14:03 +0800)
committerAsh Tyndall <git@atyndall.net>
Sat, 22 Oct 2011 06:03:28 +0000 (14:03 +0800)
globals.c
scene.c

index 90ce525..c39feec 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.2;
+GLfloat leftrightFactor = 0.1, nearfarFactor = 0.1, bigsmallFactor = 0.6, updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.2;
 
 /* Beginning width, height */
 int width = 750, height = 750;
diff --git a/scene.c b/scene.c
index 90da255..57803e5 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -305,16 +305,9 @@ void motion(int x, int y) {
 \r
       if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
         // w: left/right, h: near/far\r
-\r
-        // **NOTE: Currently a work in progress, does not work correctly\r
         float angler = 2 * M_PI * ( (rotate*camRotateFactor)/360.0 );\r
-        printf("cam angle: %f\n", rotate*camRotateFactor);\r
-\r
-        sceneObjs[curObject].x += diffx * cos(angler) * 1.0 + diffy * cos(M_PI/2 + angler) * 0.1;\r
-        sceneObjs[curObject].z += diffx * sin(angler) * 1.0 + diffy * sin(M_PI/2 + angler) * 0.1;\r
-\r
-        //sceneObjs[curObject].x += ;\r
-        //sceneObjs[curObject].z += ;\r
+        sceneObjs[curObject].x += diffx * cos(angler) * leftrightFactor + diffy * cos(M_PI/2 + angler) * nearfarFactor;\r
+        sceneObjs[curObject].z += diffx * sin(angler) * leftrightFactor + diffy * sin(M_PI/2 + angler) * nearfarFactor;\r
 \r
       } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {\r
         // w: big/small\r

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