作者: | 来源:互联网 | 2023-09-08 19:35
ItriedgooglingandsearchingonstackbutIdidntfindanything:-((Mappingirregularshapesor
I tried googling and searching on stack but I didn't find anything :-(
( Mapping irregular shapes or other polygons (cartoons, sprites) to triangles in OpenGL ES )
我尝试使用谷歌搜索和搜索堆栈,但我没有找到任何东西:-((将不规则形状或其他多边形(卡通,精灵)映射到OpenGL ES中的三角形)
I want to draw a filled polygon in OpenGL ES on iPad (2D, don't need 3D) (I'm new to OpenGL && OpenGL ES) It seems simple on OpenGL but with ES with just can draw triangle.
我想在iPad上的OpenGL ES中绘制一个填充多边形(2D,不需要3D)(我是OpenGL && OpenGL ES的新手)。在OpenGL上看起来很简单但是ES只能画三角形。
But I can't find any good tutorial about this :-( Does it exist any wrapper / library or anything else that could help me ?
但我找不到任何关于此的好教程:-(是否存在任何包装/库或其他任何可以帮助我的东西?
I don't want to use CoreGraphics, it's too slow for what I'm doing ^^
And if possible, avoiding too (big) library like Cocos2D.
我不想使用CoreGraphics,它对我正在做的事情来说太慢了^^如果可能的话,避免像Cocos2D这样的(大)库。
Edit : Working On the Problem, here are some useful links (will edit)
Links
- Polygon Triangulation
http://www.vterrain.org/Implementation/Libs/triangulate.html
http://en.wikipedia.org/wiki/Polygon_triangulation (WIKI) http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml (polygon WITHOUT holes) http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html (polygon WITH holes, C code)
编辑:解决问题,这里有一些有用的链接(将编辑)链接 - 多边形三角测量http://www.vterrain.org/Implementation/Libs/triangulate.html http://en.wikipedia.org/wiki/Polygon_triangulation (WIKI)http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml(没有孔的多边形)http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html(带孔的多边形, C代码)
Solution
I will try using polygon tessellation to get triangles. At first I'm going to try ( http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml ) and as I need polygon with holes, the second one ( http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html ). If anyone has a better way, PLEASE, tell me with a comment ^^
解决方案我将尝试使用多边形细分来获取三角形。起初我要尝试(http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml),因为我需要带孔的多边形,第二个(http://www.cs.unc.edu/~) dm / CODE / GEM / chapter.html)。如果有人有更好的方法,请告诉我评论^^
Thanks :-)
6 个解决方案