X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=618c1aeac78d29da927b7e7e0ff2febeb21f077b;hp=3ffe29f0c5dd883bf2fb936bd144411d23fbe9c0;hb=f17147662a091d75d8ab9fb984722caf0e3067ae;hpb=b193dedb61a85a497738729f67e02c593a447d77 diff --git a/scene.c b/scene.c index 3ffe29f..618c1ae 100644 --- a/scene.c +++ b/scene.c @@ -356,8 +356,8 @@ void motion(int x, int y) { 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; + lightObjs[i].position[0] += diffx * cos(angler) * lleftrightFactor + diffy * cos(M_PI/2 + angler) * lnearfarFactor; + lightObjs[i].position[2] += diffx * sin(angler) * lleftrightFactor + diffy * sin(M_PI/2 + angler) * lnearfarFactor; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: increase/decrease some light param