X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=c9ec1271fb968ee7b830df79e488493ae42b834b;hb=88cc1cef079f2ece6307c46634a0ef277fc38af8;hp=638683e95c05a4d7fb817c282d537057b32aefac;hpb=a94c1e2ec02ba03c8f7c4dee751f2eded3203b8f;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 638683e..c9ec127 100644 --- a/scene.c +++ b/scene.c @@ -570,37 +570,30 @@ 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); - glColor4f(1.0, 1.0, 1.0, 0.3); 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(); }