PDA

View Full Version : How to draw a polygon in OpenGL ES ?



anime.igala.net
09-17-2009, 03:25 AM
Hello guys,

I'm using OpenGL ES on Symbian. It does not support polygon primitive type.

I'm wondering how can I draw a polygon in any shape, some thing like this:

http://img188.imageshack.us/img188/3212/shape.png

and I want to fill it with a texture, so I cannot use lines.

Thanks,

ZbuffeR
09-17-2009, 03:44 AM
In standard OpenGL also, filled concave polygons like yours can not be drawn.
Either you split it in triangles by hand, either you do that algorithmically (not sure how to do that efficiently though).

anime.igala.net
09-18-2009, 08:33 AM
I found this page: http://codesuppository.blogspot.com/2009/07/polygon-triangulator-ear-clipping.html

But it does not work for me. Does any one have a working source? I don't want to redo from scratch.

Thanks,