Convert polygon to triangles [closed]

ⅰ亾dé卋堺 提交于 2019-12-18 13:14:15

问题


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.


回答1:


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




回答2:


Implement Chazelle's method. Triangulation in linear time! What's not to like? :)

More realistically, poly2tri.




回答3:


GLU tesselators provide a flexible way to do this.



来源:https://stackoverflow.com/questions/7316000/convert-polygon-to-triangles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!