X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=cf969764d25b892d4d766b92d800c07819d656be;hp=1d9868cb934fe84ef090f4618ff0ebb4f5f8726b;hb=bf419bc7b47235edddd11094230ed0f02cf5d8c7;hpb=f2df66fb3d50af50622b35e5fa51c904b5a32a3f diff --git a/scene.c b/scene.c index 1d9868c..cf96976 100644 --- a/scene.c +++ b/scene.c @@ -112,6 +112,7 @@ void processLightEvents(int id) { void processObjectEvents(int id) { // **NOTE: For the testing phase, only have the teapot addSceneObject(id); + glutPostRedisplay(); } /** @@ -384,20 +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; - 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 ) { @@ -418,8 +417,9 @@ void display() { } glBindTexture(GL_TEXTURE_2D, 0); - } - glPopMatrix(); + glPopMatrix(); + } + // Draw a white ball over the light source glPushMatrix();