I tried to draw a simple polygon using these coordinates:
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(0.0f, -2.0f, 0.0f);
glVertex3f(0.5f, -1.2f, 0.0f);
glVertex3f(1.0f, -2.0f, 0.0f);
glVertex3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, -0.1f, 0.0f);
It is supposed to look like a X where the sides are flat. However, the code draws the top also flat. It connects the two upper vertices directly although it is not supposed to do that. What am I doing wrong and how do I fix it?
dude the shape those coordinates are making in my mind look nothing like an X
more like a mess
your not doing anything wrong i can see, just shift the vertices so you can get a reconizeable shape, then refine them to make the shape your desire.
Well, let me try to clarify the mess a little bit
It is supposed to look like a rectangle whose top and bottom are concave. Hope this helps.
The problem is that the shape you are trying to draw is concave, and GL_POLYGON can only be a convex polygon. You’ll have to split it down the middle into two convex polygons.
[This message has been edited by DFrey (edited 05-04-2001).]
Many thanks for the hint DFrey.