In order to create a VBO in OpenGl, I need to convert polygons to triangles. Is there an example of script/code somewhere that would describe this ? I would need something robust for convex and concave polygons.
11
votes
3 Answers
14
votes
Ear clipping is by far the best way to do this.
It is fully robust for both convex and concave polygons and runs in O(n^2) time
6
votes
Implement Chazelle's method. Triangulation in linear time! What's not to like? :)
More realistically, poly2tri.