X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=9fc30e76005acac8a89da7b455c5c55479a8c3f1;hp=954d75ce1f1ec1f31daf757659c977469966fc95;hb=2d70944922c54d4814b5fcd779a884ba259c4742;hpb=272fb88381b2021bc430384231d0d2fcd64fa1b6 diff --git a/scene.c b/scene.c index 954d75c..9fc30e7 100644 --- a/scene.c +++ b/scene.c @@ -123,8 +123,8 @@ GLfloat angle = -150; /* in degrees */ GLfloat angle2 = 30; /* in degrees */ /* Near and far parameters */ -GLfloat near = -100; -GLfloat far = 100; +GLfloat near = -10; +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