Advertisement

drawing a grid

Started by May 10, 2001 11:57 AM
0 comments, last by omegasyphon 23 years, 9 months ago
how do you draw a grid with triangle strips. i cant seem to get mine to work. you would think 2 for loops would do it doesnt.
  

	for (x;x<100.0;x+=10.0f)
	{
		for (y;y<100.0;y+=10.0f)
		{
			glBegin(GL_TRIANGLE_STRIP);
				glVertex3f(x+10.0f,y,0.0f);
				glVertex3f(x,y,0.0f);			
				glVertex3f(x+10.0f,y+10.0f,0.0f);
				glVertex3f(x,y+10.0f,0.0f);
			glEnd();
		}
	}
  
well i figured out a way to draw a grid without the loops by using indexes and vertices.

This topic is closed to new replies.

Advertisement