X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=0251439ca2796b485987d7a6ecc6a3f7552e6151;hp=c1e1eb9a8c39a256d8b530cee905d49319472f7b;hb=43f828e85c0789fe860634ac0944d96f94c5c69c;hpb=bc1e4447312bdfb7fd6bc13cfbec364b96d5806e diff --git a/scene.c b/scene.c index c1e1eb9..0251439 100644 --- a/scene.c +++ b/scene.c @@ -385,21 +385,18 @@ 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("%d, %d, %d\n", *rv[0], *rv[1], *rv[2]); - /* glRotatef(so.rotation.parameter, *rv[0], *rv[1], *rv[2]); + //glRotatef(so.rotation.amount, so.rotation.vector[0], so.rotation.vector[1], so.rotation.vector[2]); // Apply scaling vector - vector* sv = so.scale; - glScalef(*sv[0], *sv[1], *sv[2]); + glScalef(so.scale[0], so.scale[1], so.scale[2]); // Apply translation vector - glTranslatef(so.x, so.y, so.z); + //glTranslatef(so.x, so.y, so.z); // Apply texture if ( so.texture > 0 ) { @@ -407,7 +404,7 @@ void display() { glBindTexture(GL_TEXTURE_2D, so.texture); } else { glBindTexture(GL_TEXTURE_2D, 0); - }*/ + } // Draw actual object if ( so.mesh > 0 ) { @@ -420,8 +417,9 @@ void display() { } glBindTexture(GL_TEXTURE_2D, 0); - } - glPopMatrix(); + glPopMatrix(); + } + // Draw a white ball over the light source glPushMatrix();