From: Ash Tyndall Date: Sat, 22 Oct 2011 04:53:41 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=f58aed98d64aef9753f2b26e41db597c9df1dce4;p=atyndall%2Fcits2231.git --- 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);