X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=f4b4343b2617ea1c8ef343c936f7eca43903376c;hp=99a95e54503793d60d16283483941eea7012b950;hb=f58aed98d64aef9753f2b26e41db597c9df1dce4;hpb=d94feaa1fc0039ef6ec3c3a16fe022da86038177 diff --git a/scene.c b/scene.c index 99a95e5..f4b4343 100644 --- a/scene.c +++ b/scene.c @@ -328,6 +328,8 @@ void motion(int x, int y) { case STATE_OBJECT_ROTATION_TEXTURE_SCALE: + // FML DOES NOT ROTATE PROPERLY + if ( buttonSelected == GLUT_LEFT_BUTTON ) { // w: rotate on y sceneObjs[curObject].rotation.y += diffx * rotateFactor; @@ -426,6 +428,9 @@ void display() { glPushMatrix(); SceneObject so = sceneObjs[i]; + // Apply translation vector + glTranslatef(so.x, so.y, so.z); + // Apply independant rotation vectors glRotatef(so.rotation.x, 1.0, 0.0, 0.0); glRotatef(so.rotation.y, 0.0, 1.0, 0.0); @@ -434,9 +439,6 @@ void display() { // Apply scaling vector glScalef(so.scale[0], so.scale[1], so.scale[2]); - // Apply translation vector - glTranslatef(so.x, so.y, so.z); - // Apply texture if ( so.texture.id > 0 ) { getTexture(so.texture.id);