X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=b4b61c5473ebb35a6da5129bdae56e5d9178a3a4;hp=902e5991e7f50edacfa75e121c77e911c3fd9083;hb=9df9f47276976d5030519601404f5681e15ebce9;hpb=09c3124c81ac8607bcb0cdc8dcce79f08f8a1736 diff --git a/scene.c b/scene.c index 902e599..b4b61c5 100644 --- a/scene.c +++ b/scene.c @@ -385,18 +385,17 @@ void display() { drawFloor(); // Draw sceneObjs array - glPushMatrix(); - for ( int i = 0; i < nObjects; i++ ) { + for ( int i = 0; i < nObjects; i++ ) { + glPushMatrix(); SceneObject so = sceneObjs[i]; // Apply rotation vector - vector* rv = so.rotation.vect; - printf("%f, %f, %f\n", *rv[0], *rv[1], *rv[2]); - /* glRotatef(so.rotation.parameter, *rv[0], *rv[1], *rv[2]); + GLfloat* rv = so.rotation.vector; + glRotatef(so.rotation.amount, rv[0], rv[1], rv[2]); // Apply scaling vector - vector* sv = so.scale; - glScalef(*sv[0], *sv[1], *sv[2]); + GLfloat* sv = so.scale; + glScalef(sv[0], sv[1], sv[2]); // Apply translation vector glTranslatef(so.x, so.y, so.z); @@ -407,7 +406,7 @@ void display() { glBindTexture(GL_TEXTURE_2D, so.texture); } else { glBindTexture(GL_TEXTURE_2D, 0); - }*/ + } // Draw actual object if ( so.mesh > 0 ) { @@ -420,8 +419,9 @@ void display() { } glBindTexture(GL_TEXTURE_2D, 0); - } - glPopMatrix(); + glPopMatrix(); + } + // Draw a white ball over the light source glPushMatrix();