X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=d829def5640d484cbadb5e0218aae08a20af442c;hb=05197548c4c303f66cc7cae18d3cc134b0dfae96;hp=d57ce236c2cb3e1cd1d8059d647c2555bf57ee98;hpb=2c476859ea065ecf70df3f54f2b88a519a02cece;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index d57ce23..d829def 100644 --- a/scene.c +++ b/scene.c @@ -529,7 +529,7 @@ drawFloor(void) static GLfloat lightColor[] = {1.0, 1.0, 1.0, 1.0}; /* green-tinted */ static GLfloat lightPosition[4]; -static float lightAngle = 0.0, lightHeight = 20; +static float lightAngle = 10.0, lightHeight = 20; /** @@ -557,7 +557,7 @@ void display() { glPushMatrix(); glDisable(GL_LIGHTING); - glColor3f(1.0, 1.0, 0.0); + glColor3f(1.0, 1.0, 1.0); /* Draw a yellow ball at the light source. */ glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]); @@ -582,7 +582,7 @@ void init() { glMatrixMode(GL_PROJECTION); gluPerspective( - 40.0, /* field of view in degree */ + 60.0, /* field of view in degree */ 1.0, /* aspect ratio */ 0.0, /* Z near */ 900.0 /* Z far */ @@ -595,6 +595,8 @@ void init() { 0.0, 1.0, 0.0 /* up is in postivie Y direction */ ); + glTranslatef( 0.0f, 0.0f, -25.0f); // Move into the Screen 10.0 + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1); glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor); glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1);