drawing concave polygons

I am in need of some advice on splitting concave polygons into convex polygons and then drawing them. The only code I can find for such things online is about tesselations. But i need some advice about how to do it without doing that, i was thinking of maybe doing something with the GL_TRIANGLE_FAN function maybe, but what I have so far doesn’t work. Any advice / links would be appreciated.

Hi !

That is the only solution unless you want to use some external code outside OpenGL, the glu tesselator can convert your polygon to a triangle fan/strip and you can save it in a display list for later rendering for example.

Mikael

There is also an approach that will work with stencil but it is very brute force.

http://www.mmrc.iss.ac.cn/~mli/RedBook/20005.html

OpenGL does not really support concave polygon rendering well. This is a deliberate decision because it is an inherently expensive proposition. Forcing applications and developers to deal with the problem instead of providing them with an API to support bad practice for hardware design is the reason we have no easy concave polygon support.

I’m just curios: is there a reason that tesselation is unacceptable?