From a1e8cc05bcd4c196af65e62a757a7a8fdc06ace7 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Sat, 22 Oct 2011 15:12:33 +0800 Subject: [PATCH] --- scene.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scene.c b/scene.c index 42b717c..3ffe29f 100644 --- a/scene.c +++ b/scene.c @@ -347,19 +347,24 @@ void motion(int x, int y) { break; case STATE_LIGHT_1_MOVE: - case STATE_LIGHT_2_MOVE:; + case STATE_LIGHT_2_MOVE: + ; // Semi-colon required to allow variable declaration below int i = 0; if ( manipulateState == STATE_LIGHT_2_MOVE ) i = 1; if ( buttonSelected == GLUT_LEFT_BUTTON ) { + // w: left/right, h: near/far float angler = 2 * M_PI * ( (rotate*camRotateFactor)/360.0 ); lightObjs[i].position[0] += diffx * cos(angler) * leftrightFactor + diffy * cos(M_PI/2 + angler) * nearfarFactor; lightObjs[i].position[2] += diffx * sin(angler) * leftrightFactor + diffy * sin(M_PI/2 + angler) * nearfarFactor; - } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { + // w: increase/decrease some light param + // **NOTE: Currently not implemented + // h: up/down + lightObjs[i].position[1] -= diffy * updownFactor; } break; -- 2.20.1