X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=5dd48fdfde6d22b7f31f02a392a4a32103cec614;hp=0834fa2bdf557eb9c2e414b84da3e02de7aee144;hb=39d7272ede4e1ad75c15c9b7c4394e833df4591b;hpb=f8d9a447d9658d88f8088afb88d0d92e8087172c diff --git a/scene.c b/scene.c index 0834fa2..5dd48fd 100644 --- a/scene.c +++ b/scene.c @@ -307,10 +307,11 @@ void motion(int x, int y) { // w: left/right, h: near/far // **NOTE: Currently a work in progress, does not work correctly + float angler = 2*M_PI*((rotate*camRotateFactor)/360); printf("cam angle: %f\n", rotate*camRotateFactor); // float arc = arctan() - sceneObjs[curObject].x += diffx * sin(rotate*camRotateFactor) * 0.3; - sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor) * 0.3; + sceneObjs[curObject].x += diffx * sin(angler) * 0.3; + sceneObjs[curObject].z += diffx * cos(angler) * 0.3; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small