X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=5efecaf43bece5c93b0d57ad47c709514d399c31;hp=b724f2412e5dc9e90e36e25bc832fc28ba0280ed;hb=ccafea19dd13dcd3ef20b521cd629096df97660c;hpb=0c3bf9aaef7eff8c29473078889170b68657cb8c diff --git a/scene.c b/scene.c index b724f24..5efecaf 100644 --- a/scene.c +++ b/scene.c @@ -308,9 +308,9 @@ void motion(int x, int y) { // w: left/right, h: near/far //so.x, so.y, so.z //sceneObjs[curObject].x += (x - startx)*leftrightFactor; - printf("cam angle: %f\n", camAngle*camAngleFactor); - sceneObjs[curObject].x += (x - startx) * sin(90 - camAngle*camAngleFactor); - sceneObjs[curObject].z += (x - startx) * cos(90 - camAngle*camAngleFactor); + printf("cam angle: %f\n", rotate*rotateFactor); + sceneObjs[curObject].x += (x - startx) * sin(rotate*rotateFactor); + sceneObjs[curObject].z += (x - startx) * cos(rotate*rotateFactor); } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small float diff = (x - startx);