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

查看:232
本文介绍了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天全站免登陆