OpenGL ES - 如何绘制填充多边形? [英] OpenGL ES - How to Draw a filled Polygon?

查看:31
本文介绍了OpenGL ES - 如何绘制填充多边形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在堆栈上进行谷歌搜索和搜索,但没有找到任何东西 :-(
( 映射不规则形状或其他多边形 (卡通,精灵)到OpenGL ES中的三角形)

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 )

我想在 iPad 上的 OpenGL ES 中绘制一个填充的多边形(2D,不需要 3D)(我是 OpenGL && 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.

但是我找不到任何关于这个的好教程:-(它是否存在任何包装器/库或其他可以帮助我的东西?

But I can't find any good tutorial about this :-( Does it exist any wrapper / library or anything else that could help me ?

不想使用 CoreGraphics,我正在做的事情太慢了^^
如果可能的话,避免像 Cocos2D 这样太(大)的库.

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.

编辑:解决问题,这里有一些有用的链接(将编辑)
链接
- 多边形三角剖分
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代码)

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.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml ),因为我需要带孔的多边形,第二个( http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html).如果有人有更好的方法,请在评论中告诉我 ^^

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 ^^

谢谢:-)

推荐答案

Cocos2D 很酷的库封装了OpenGL,有很多有用的功能(主要用于游戏但不限于).

Cocos2D is cool library wrapping OpenGL and has many useful features ( mainly for games but not limited to ).

对于多边形细分,请使用:http://flipcode.net/archives/Efficient_Polygon_Triangulation.shtml我以前用过,效果很好.

For polygon tessellation use : http://flipcode.net/archives/Efficient_Polygon_Triangulation.shtml I've used it before and it worked well.

这篇关于OpenGL ES - 如何绘制填充多边形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆