From: Ash Tyndall Date: Thu, 20 Oct 2011 12:17:30 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=commitdiff_plain;h=ea1053838ec633c44e509a06a691c3bcc38acd8d --- diff --git a/globals.c b/globals.c index 91fb87b..22e33eb 100644 --- a/globals.c +++ b/globals.c @@ -75,6 +75,9 @@ int floorSize = 200; /* Current camera x, y, z coords */ GLfloat camx = 0.0, camy = 0.0, camz = 0.0, rot = 0.0; +/* Length of axis lines */ +GLfloat lineLength = 100; + /* Light 0 parameters */ GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0}; GLfloat ambient0[] = {0.0, 0.0, 0.0, 1.0}; diff --git a/globals.h b/globals.h index 728bf6a..71a21c2 100644 --- a/globals.h +++ b/globals.h @@ -65,6 +65,9 @@ extern int floorSize; /* Current camera position */ extern GLfloat camx, camy, camz, rot; +/* Length of axis lines */ +extern GLfloat lineLength; + /* Light 0 parameters */ extern GLfloat diffuse0[]; extern GLfloat ambient0[]; diff --git a/helper.c b/helper.c index d685e51..e5d9c0b 100644 --- a/helper.c +++ b/helper.c @@ -262,8 +262,13 @@ void drawLine() { 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); + glVertex3i( lineLength, 1.0, 0.0 ); + glVertex3i( -lineLength, 1.0, 0.0 ); + glEnd(); + + glBegin(GL_LINES); + glVertex3i( 0.0, 1.0, lineLength ); + glVertex3i( 0.0, 1.0, -lineLength ); glEnd(); glDisable(GL_BLEND);