From: Ash Tyndall Date: Tue, 18 Oct 2011 03:48:46 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=6c7174b9047d08634cac3b36e641d8342ffacc2f;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index 638683e..7808d37 100644 --- a/scene.c +++ b/scene.c @@ -570,18 +570,9 @@ void display() { // lightPosition[3] = 1.0; //} - glPushMatrix(); - - /* Tell GL new light source position. */ + glPushMatrix(); glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); - /* Draw "bottom" of floor in blue. */ - glFrontFace(GL_CW); /* Switch face orientation. */ - glColor4f(0.1, 0.1, 0.7, 1.0); - drawFloor(); - glFrontFace(GL_CCW); - - /* Draw "top" of floor. Use blending to blend in reflection. */ glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.7, 0.0, 0.0, 0.3); @@ -589,18 +580,22 @@ void display() { drawFloor(); glDisable(GL_BLEND); + glutSolidTeapot(1); + glPushMatrix(); glDisable(GL_LIGHTING); + glColor3f(1.0, 1.0, 0.0); /* Draw a yellow ball at the light source. */ glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]); glutSolidSphere(1.0, 5, 5); - glEnable(GL_LIGHTING); + glEnable(GL_LIGHTING); glPopMatrix(); - drawFloor(); - glutSwapBuffers(); + glPopMatrix(); + + glutSwapBuffers(); }