X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=c46f1739dd236e29efee83966da803b8e890317f;hp=281f99f8f29cf903c31e076c2eb0275ce8d0613b;hb=3e4ca5f8fbd515f749d11f52191356ea90ea3041;hpb=2a9451d5c45eda1d68677b519784bd9756f72260 diff --git a/scene.c b/scene.c index 281f99f..c46f173 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); - sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor); + + sceneObjs[curObject].x += diffy * sin(angler) * 0.1; + //sceneObjs[curObject].x += diffx * cos(angler) * 0.1; + + sceneObjs[curObject].z += diffx * sin(angler) * 0.1; + //sceneObjs[curObject].z += diffy * cos(angler) * 0.1; + + //sceneObjs[curObject].x += ; + //sceneObjs[curObject].z += ; } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: big/small @@ -413,7 +420,7 @@ void display() { glPushMatrix(); /* Perform scene rotations based on user mouse/keyboard input. */ - //glRotatef(rotate*camRotateFactor, 0.0, 1.0, 0.0); + glRotatef(rotate*camRotateFactor, 0.0, 1.0, 0.0); glTranslatef(camx, camy, camz); glRotatef(keyrot, 1.0, 0.0, 0.0);