X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=d6b3e8fe51f3038e982e25f871b5fe4ef871e9f7;hp=78ac064e9e2188f93f4e0f59ced12139865c1b0c;hb=168b99f77c5c0defa67c22beb64f44dbe03c7b22;hpb=80eec6fadf0959fc87376028a8fd0ab9c5b8cb89 diff --git a/scene.c b/scene.c index 78ac064..d6b3e8f 100644 --- a/scene.c +++ b/scene.c @@ -124,7 +124,7 @@ GLfloat angle2 = 30; /* in degrees */ /* Near and far parameters */ GLfloat near = -10; -GLfloat far = 50; +GLfloat far = 10; /* Zoom factor for mouse movements */ GLfloat zoomFactor = 1.0; @@ -611,14 +611,15 @@ void drawFloor() { * Draw x, z axis on floor */ void drawLine() { + // **NOTE: fix function glDisable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4ub( 0.0, 0.0, 0.0, 0.0 ); + glColor4ub( 0.0, 0.0, 0.0, 0.5 ); glBegin(GL_LINES); - glVertex3i( 10.0, 0, 0.0); - glVertex3i( -10.0, 0, 0.0); + glVertex3i( 10.0, 0.1, 10.0); + glVertex3i( -10.0, 0.1, -10.0); glEnd(); glDisable(GL_BLEND); @@ -636,6 +637,12 @@ void display() { 0.0, 0.0, 0.0, /* center is at (x,y,z) */ 0.0, 1.0, 0.0 /* up is in postivie Y direction */ ); + glEnable(GL_LIGHT0); + glLightfv(GL_LIGHT0, GL_POSITION, light0_pos); + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0); + glLightfv(GL_LIGHT0, GL_SPECULAR, specular0); + glEnable(GL_LIGHTING); // **NOTE: Currently this rotation function is all that moves the camera off // the flat surface. Need to integrate function into gluLookAt