60 glPushAttrib ( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT );
61 glRotatef(-90, 1.0, 0.0, 0.0);
63 glEnable ( GL_POLYGON_OFFSET_LINE );
64 glEnable ( GL_LINE_SMOOTH );
65 glPolygonOffset ( .5,.5 );
66 glColor3f ( 0.8f, 0.8f, 1.0f );
68 for (
int temp = -count; temp <= count; temp +=1 )
70 glVertex3i ( temp * increment, -increment * count, 0 );
71 glVertex3i ( temp * increment, increment * count, 0 );
72 glVertex3i ( -increment * count, temp * increment, 0 );
73 glVertex3i ( increment * count, temp * increment, 0 );
76 glColor3f ( 0.8f, 0.8f, 0.8f);
77 for (
int temp = -count; temp <= count; temp +=5 )
79 glVertex3i ( temp * increment, -increment * count, 0 );
80 glVertex3i ( temp * increment, increment * count, 0 );
81 glVertex3i ( -increment*count, temp * increment, 0 );
82 glVertex3i ( increment*count, temp * increment, 0 );
84 glDisable ( GL_POLYGON_OFFSET_LINE );
87 glDisable ( GL_LINE_SMOOTH );
96 glDisable(GL_LIGHTING);
98 glEnable(GL_LIGHTING);
A 4x4 matrix class implementation for use with the provided vertex types.
void drawGrid(int increment, int count)