X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=642fdcdc5bfce55a355ca9e68597233e8effdc66;hp=aa27999a91754bcc6b1640e3caab53ad2018d92b;hb=ec50cae176e4a0ec67a756f779adbdf700362924;hpb=4cf287426fae4fe7d4bf5296453c91307314f8f1 diff --git a/scene.c b/scene.c index aa27999..642fdcd 100644 --- a/scene.c +++ b/scene.c @@ -340,7 +340,9 @@ void display() { glPushMatrix(); glTranslatef(0.0, 0.5, 0.0); // **NOTE: Teapot currently does not rest on surface glColor3f(0.0, 0.0, 0.0); + glFrontFace(GL_CW); glutSolidTeapot(1); + glFrontFace(GL_CCW); glPopMatrix(); // Draw a white ball over the light source @@ -371,11 +373,11 @@ void init() { glLightModelfv(GL_LIGHT_MODEL_AMBIENT, glightmodel); - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emission0); - glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shine); + glMaterialfv(GL_FRONT, GL_AMBIENT, ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, specular); + glMaterialfv(GL_FRONT, GL_EMISSION, emission0); + glMaterialf(GL_FRONT, GL_SHININESS, shine); glEnable(GL_LIGHT0); glEnable(GL_LIGHTING); @@ -413,6 +415,7 @@ int main(int argc, char **argv) { glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // the type glEnable(GL_TEXTURE_2D); + glEnable(GL_CULL_FACE); glEnable(GL_NORMALIZE); glLineWidth(2.0);