X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=9fc30e76005acac8a89da7b455c5c55479a8c3f1;hb=2d70944922c54d4814b5fcd779a884ba259c4742;hp=7afde9cd41ca880037b945980ede82e8eef951d6;hpb=f8f4c489085c83bc31276148991166165085b557;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 7afde9c..9fc30e7 100644 --- a/scene.c +++ b/scene.c @@ -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