Reputation:
Is this possible? (I know, it is, but I can't do it.)
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.
Upvotes: 2
Views: 356
Reputation:
With help from my friend geometry :)
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);
// Draw a triangle strip.
glBegin(GL_TRIANGLE_STRIP);
glVertex3f(10.0, 10.0, 0.0);
glVertex3f(20.0, 10.0, 0.0);
glVertex3f(12.0, 30.0, 0.0);
glVertex3f(22.0, 30.0, 0.0);
glVertex3f(17.0, 80.0, 0.0);
glVertex3f(26.0, 70.0, 0.0);
glVertex3f(35.0, 80.0, 0.0);
glVertex3f(31.0, 40.0, 0.0);
glVertex3f(42.0, 35.0, 0.0);
glVertex3f(23.0, 40.0, 0.0);
glVertex3f(25.0, 35.0, 0.0);
glVertex3f(21.9, 30.0,0.0);
glVertex3f(42.0, 35.0, 0.0);
glVertex3f(32.0, 30.0, 0.0);
glVertex3f(46.0, 10.0, 0.0);
glVertex3f(36.5, 10.0, 0.0);
glEnd();
glFlush();
}
Upvotes: 3