X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=5e492e5e786cbeb31a9e0eb8965d164132a3bf04;hp=bc532dee2a0a8d7f985ccf598ab791374add9b3b;hb=664a6aa10f9219f5e8c52ae9f05f68615a548457;hpb=0c13828a5bdb03598b1da15ed6b1594b3fcfa896 diff --git a/scene.c b/scene.c index bc532de..5e492e5 100644 --- a/scene.c +++ b/scene.c @@ -594,7 +594,7 @@ void drawSquare(int recurseLevel, float x1, float y1, float x2, float y2) { */ void drawFloor() { -drawSquare(0, -1000.0, -1000.0, 1000.0, 1000.0); +drawSquare(0, -100.0, -100.0, 100.0, 100.0); /*if (useTexture) { glDisable(GL_TEXTURE_2D); @@ -640,7 +640,7 @@ void display() { glPushMatrix(); - //glTranslatef(0.0, 0.0, 0.0); + glTranslatef(0.0, 1.0, 0.0); glutWireTeapot(1); // Draw teapot for test glPopMatrix(); @@ -650,7 +650,7 @@ void display() { /* Draw a yellow ball at the light source. */ glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]); - glutSolidSphere(1.0, 5, 5); + glutSolidSphere(1.0, 50, 50); glEnable(GL_LIGHTING); glPopMatrix(); @@ -670,12 +670,12 @@ void init() { gluPerspective( 60.0, /* field of view in degree */ 1.0, /* aspect ratio */ - -1000.0, /* Z near */ - 1000.0 /* Z far */ + -100.0, /* Z near */ + 100.0 /* Z far */ ); glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1); - glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor); + glLightfv(GL_LIGHT0, GL_AMBIENT|GL_SPECULAR|GL_DIFFUSE, lightColor); glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1); glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05); glEnable(GL_LIGHT0);