X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=d351afaf6e46642280b1830f3b0e92eee9e3b025;hb=3252ebe3045e51d4cf9ee40f24e7204e230492d6;hp=b55b4914a9729934793e5e50b739fa5964804780;hpb=c428c0599a28210a4f17b3c49bfd0e61019f6b02;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index b55b491..d351afa 100644 --- a/scene.c +++ b/scene.c @@ -385,18 +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("%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; + printf("%f, %f, %f\n", so.rotation.vector[0], so.rotation.vector[1], so.rotation.vector[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]); + //GLfloat* sv = &so.scale; + glScalef(so.scale[0], so.scale[1], so.scale[2]); // Apply translation vector glTranslatef(so.x, so.y, so.z); @@ -407,7 +407,7 @@ void display() { glBindTexture(GL_TEXTURE_2D, so.texture); } else { glBindTexture(GL_TEXTURE_2D, 0); - }*/ + } // Draw actual object if ( so.mesh > 0 ) { @@ -420,8 +420,9 @@ void display() { } glBindTexture(GL_TEXTURE_2D, 0); - } - glPopMatrix(); + glPopMatrix(); + } + // Draw a white ball over the light source glPushMatrix();