// Draw square.
// **NOTE: We're drawing large strips, instead of squares, which might cause a lighting problem
glBegin(GL_QUADS);
- glNormal3f(0,1,0);
+ //glNormal3f(0,1,0);
+ glColor3f(1.0, 1.0, 1.0);
glVertex3f(x1, 0.0, z1);
glVertex3f(x1, 0.0, z2);
glVertex3f(x2, 0.0, z2);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3f( 0.0, 0.0, 0.0 );
+ float arrowLength = 1.0;
+
glBegin(GL_LINES);
+ // x arrow
glVertex3i( lineLength, 0.0, 0.0 );
glVertex3i( -lineLength, 0.0, 0.0 );
- glEnd();
+
+ // x arrowheads
+ glVertex3i( lineLength, 0.0, 0.0 );
+ glVertex3i( lineLength - arrowLength, 0.0, 1.0 );
- glBegin(GL_LINES);
- glVertex3i( 0.0, 0.0, lineLength );
- glVertex3i( 0.0, 0.0, -lineLength );
+ glVertex3i( lineLength, 0.0, 0.0 );
+ glVertex3i( lineLength - arrowLength, 0.0, -1.0 );
+
+ // z arrow
+ glVertex3i( 0.0, 0.0, lineLength );
+ glVertex3i( 0.0, 0.0, -lineLength );
+
+ // z arrowheads
+ glVertex3i( 0.0, 0.0, lineLength );
+ glVertex3i( 1.0, 0.0, lineLength - arrowLength );
+
+ glVertex3i( 0.0, 0.0, lineLength );
+ glVertex3i( -1.0, 0.0, lineLength - arrowLength );
glEnd();
glDisable(GL_BLEND);