PDA

View Full Version : Drawing an A using a single GL_TRIANGLE_STRIP.



HMPARTICLE
11-25-2015, 03:07 PM
void drawScene(void)
{

glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 0.0);
if (isWire)
glPolygonMode(GL_FRONT, GL_LINE);
else
glPolygonMode(GL_FRONT, GL_FILL);

glBegin(GL_TRIANGLE_STRIP);
glVertex3f(10,10,0);
glVertex3f(20,10,0);

glVertex3f(30,80,0);
glVertex3f(40,70,0);

glVertex3f(50,80,0);
glVertex3f(60,10,0);

glVertex3f(70,10,0);
glEnd();

glBegin(GL_TRIANGLE_STRIP);

glEnd();

glFlush();
}


There is my attempt, although my next idea would be to bridge the legs of the A. But I would like to do it in one single strip.
The hackish idea I had would look dreadful in wireframe.