From f58aed98d64aef9753f2b26e41db597c9df1dce4 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Sat, 22 Oct 2011 12:53:41 +0800 Subject: [PATCH] --- scene.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.20.1