X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=b02b4f1d1dfdf3c07d8a4c388f2d02bc0fc8d7e3;hp=a0fbff18df54e6e473c8f518462e5a2dd1ce3bf8;hb=faf8b6a77994ac32ffff814c08fe59e70431f5d7;hpb=295ff719ec8db6df738d0210005a948eb2507c77 diff --git a/scene.c b/scene.c index a0fbff1..b02b4f1 100644 --- a/scene.c +++ b/scene.c @@ -306,7 +306,7 @@ void motion(int x, int y) { if ( buttonSelected == GLUT_LEFT_BUTTON ) { // w: left/right, h: near/far - // **NOTE: Currently a work in progress + // **NOTE: Currently a work in progress, does not work correctly printf("cam angle: %f\n", rotate*camRotateFactor); sceneObjs[curObject].x += diffx * sin(rotate*camRotateFactor); sceneObjs[curObject].z += diffx * cos(rotate*camRotateFactor); @@ -327,19 +327,25 @@ void motion(int x, int y) { break; case STATE_OBJECT_ROTATION_TEXTURE_SCALE: + if ( buttonSelected == GLUT_LEFT_BUTTON ) { // w: rotate on y sceneObjs[curObject].rotation.y += diffx * rotateFactor; + // h: rotate on x sceneObjs[curObject].rotation.x += diffy * rotateFactor; + } else if ( buttonSelected == GLUT_MIDDLE_BUTTON ) { // w: rotate on x sceneObjs[curObject].rotation.x += diffx * rotateFactor; + // h: texture scale float max = (float)height/texscaleFactor; float scaling = (diffy + max) / max; sceneObjs[curObject].texture.scale *= scaling; + } + break; }