X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=c00cea40f7236396f053100000e7b04b541d6d13;hp=0834fa2bdf557eb9c2e414b84da3e02de7aee144;hb=c04cf2176fc88d341416c24667ba66dc3600c4d0;hpb=f8d9a447d9658d88f8088afb88d0d92e8087172c diff --git a/scene.c b/scene.c index 0834fa2..c00cea4 100644 --- a/scene.c +++ b/scene.c @@ -307,10 +307,17 @@ 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) * 0.3; - sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor) * 0.3; + + //sceneObjs[curObject].x += diffx * cos(angler) * 0.1; + sceneObjs[curObject].x += diffy * cos(M_PI/2 + angler) * 0.1; + + //sceneObjs[curObject].z += diffx * sin(angler) * 0.1; + sceneObjs[curObject].z += diffy * sin(M_PI/2 + angler) * 0.1; + + //sceneObjs[curObject].x += ; + //sceneObjs[curObject].z += ; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small