X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=b0ca735a0c2ba8f5af7ced7437819c1fa852a962;hp=99ccfa0b902ca7fdbc6102addaf2b1708302d733;hb=031b68bfabdca3258b91322fba3796d0f7386da4;hpb=97f14d98d0a9bee56fdaebcea092dba1925c9552 diff --git a/scene.c b/scene.c index 99ccfa0..b0ca735 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) * 0.1 ) + diffx * ( cos(angler) * 0.1 ); + sceneObjs[curObject].z += diffx * ( sin(angler) * 0.1 ) + diffy * ( cos(angler) * 0.1 ); + + //sceneObjs[curObject].x += ; + //sceneObjs[curObject].z += ; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small