X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=9fc30e76005acac8a89da7b455c5c55479a8c3f1;hp=9fb79f8f040751efc3c9d2e4e07a0ce6430072ab;hb=2d70944922c54d4814b5fcd779a884ba259c4742;hpb=4c003391e2564ab1a3b45e1fe9f2490b55847f98 diff --git a/scene.c b/scene.c index 9fb79f8..9fc30e7 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; @@ -607,6 +607,24 @@ void drawFloor() { drawSquare(0, -floorSize, -floorSize, floorSize, floorSize); } +/** + * Draw x, z axis on floor + */ +void drawLine() { + glDisable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4ub( 0.0, 0.0, 0.0, 0.5 ); + + glBegin(GL_LINES); + glVertex3i( 10.0, 0.1, 10.0); + glVertex3i( -10.0, 0.1, -10.0); + glEnd(); + + glDisable(GL_BLEND); + glEnable(GL_TEXTURE_2D); +} + /** * Display function */ @@ -639,6 +657,8 @@ void display() { drawFloor(); + drawLine(); + // Draw teapot for a test object glPushMatrix(); glTranslatef(0.0, 1.0, 0.0); // **NOTE: Teapot does not rest on surface