(no commit message)
authorAsh Tyndall <[email protected]>
Sat, 22 Oct 2011 07:21:10 +0000 (15:21 +0800)
committerAsh Tyndall <[email protected]>
Sat, 22 Oct 2011 07:21:10 +0000 (15:21 +0800)
globals.c
globals.h
scene.c

index 0616875..10163a9 100644 (file)
--- a/globals.c
+++ b/globals.c
@@ -88,6 +88,7 @@ GLfloat zoom = 0.0, rotate = 0.0, camAngle = 40.0;
 GLfloat zoomFactor = 0.2, camRotateFactor = 0.5, camAngleFactor = 0.5;
 GLfloat leftrightFactor = 0.05, nearfarFactor = 0.1, bigsmallFactor = 0.6;
 GLfloat updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.2;
+GLfloat lleftrightFactor = 0.005, lnearfarFactor = 0.05;
 
 /* Beginning width, height */
 int width = 700, height = 700;
index 6ec54ba..c75caf7 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -86,6 +86,7 @@ extern GLfloat zoom, rotate, camAngle;
 extern GLfloat zoomFactor, camRotateFactor, camAngleFactor;
 extern GLfloat leftrightFactor, nearfarFactor, bigsmallFactor;
 extern GLfloat updownFactor, rotateFactor, texscaleFactor;
+extern GLfloat lleftrightFactor, lnearfarFactor;
 
 /* Texture state tracking */
 extern int currentGroundTexture, currentMeshTexture;
diff --git a/scene.c b/scene.c
index 3ffe29f..618c1ae 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -356,8 +356,8 @@ void motion(int x, int y) {
       if ( buttonSelected == GLUT_LEFT_BUTTON ) {\r
         // w: left/right, h: near/far\r
         float angler = 2 * M_PI * ( (rotate*camRotateFactor)/360.0 );\r
-        lightObjs[i].position[0] += diffx * cos(angler) * leftrightFactor + diffy * cos(M_PI/2 + angler) * nearfarFactor;\r
-        lightObjs[i].position[2] += diffx * sin(angler) * leftrightFactor + diffy * sin(M_PI/2 + angler) * nearfarFactor;\r
+        lightObjs[i].position[0] += diffx * cos(angler) * lleftrightFactor + diffy * cos(M_PI/2 + angler) * lnearfarFactor;\r
+        lightObjs[i].position[2] += diffx * sin(angler) * lleftrightFactor + diffy * sin(M_PI/2 + angler) * lnearfarFactor;\r
 \r
       } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) {\r
         // w: increase/decrease some light param\r

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