Hey all,
I just started learning openGL for an application that I am working on. My task is to draw a polygon that can be:
outlined
filled
texture filled
The outlined polygon is simple with the primType GL_LINE_STRIP. When i try to draw things of the GL_POLYGON primType my object does not render correctly at all. Any suggestions to why this is happenening?
I’d recommend using GL_TRIANGLES or, even better, GL_TRIANGLE_STRIP. The latter requires a special geometry layout called a triangle strip, though (see this wikipedia article), and not all polygons can be made into such strips.
anything other then triangles are not optimized well on hardware, that is anything else has to be split up into subtriangles. even lines are rendered with two triangles on some cards. i would forget about GL_POLYGON and use TRIANGLES only and you can render convex and concave geometry.