X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=861adb331016addab9e84c162bc234b0614d722b;hp=99ccfa0b902ca7fdbc6102addaf2b1708302d733;hb=d7422056ba339abc73eec8a40758dc2863ad86cc;hpb=97f14d98d0a9bee56fdaebcea092dba1925c9552 diff --git a/scene.c b/scene.c index 99ccfa0..861adb3 100644 --- a/scene.c +++ b/scene.c @@ -307,10 +307,14 @@ 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.0 ); printf("cam angle: %f\n", rotate*camRotateFactor); - // float arc = arctan() - sceneObjs[curObject].x += diffx * sin(rotate*camRotateFactor); - sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor); + + sceneObjs[curObject].x += diffy * sin(angler) + diffx * cos(angler) * 0.1; + sceneObjs[curObject].z += diffx * sin(angler) * 0.1 + diffy * cos(angler); + + //sceneObjs[curObject].x += ; + //sceneObjs[curObject].z += ; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small