X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=69c5a820ed26fa4c983adfd966d7284f76c66f5c;hb=8ce9e04b2f947ad161075ba0a8cf822b5594d199;hp=55b185623f5a2b8f6a46e9d6c735ed285a718bab;hpb=e167fee487eef79406a5baa2757a7262811b027b;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 55b1856..69c5a82 100644 --- a/scene.c +++ b/scene.c @@ -122,6 +122,7 @@ void processObjectEvents(int id) { void processTextureEvents(int id) { if ( curObject >= 0 ) { sceneObjs[curObject].texture.id = id; + sceneObjs[curObject].texture.scale = 1; glutPostRedisplay(); } } @@ -278,8 +279,9 @@ void motion(int x, int y) { sceneObjs[curObject].rotation.x += diffx * rotateFactor; // h: texture scale + // **NOTE: Seems to be problem with scaling, delayed action float max = (float)height/texscaleFactor; - float scaling = (diffy + max) / max; + float scaling = (-diffy + max) / max; sceneObjs[curObject].texture.scale *= scaling; } @@ -354,10 +356,8 @@ void display() { glPushMatrix(); - /* Perform scene rotations based on user mouse/keyboard input. */ + /* Perform scene rotations based on user mouse input. */ glRotatef(rotate*camRotateFactor, 0.0, 1.0, 0.0); - glTranslatef(camx, camy, camz); - glRotatef(keyrot, 1.0, 0.0, 0.0); drawFloor();