views:

397

answers:

2

im looking for any information about a builtin algorithm in opengl es to convert a 3d polygon in a triangle set. is there anything implemented like that in opengl es?

+3  A: 

Short answer: No, not as a part of OpenGL ES.

Polygon tessellation is provided as part of the GLU (OpenGL Utility) library, on a per platform, per-version, per-implementer basis as it is optional rather than core to OpenGL.

If you are working on iPhone, you should have a look at iphone-glu which claims to support polygon tessellation.

Here's a more general walkthrough of using tessellation in OpenGL with GLU (not ES though) which might help illuminate your path.

vizionary
i red that its difficult to do 3d triangulation and i dont realy understand why opengl doesnt support it if its the only way to create complex polygons.. the algorithm doesnt need to be very efficient because its only executed at the creation of the polygon so i can write my own one but im realy wondering about this
Sponge
It's not included in OpenGL because OpenGL is only meant for rendering. It's not intended to be used to preprocess the data to be displayed. Is there no way you can process your data into an OpenGL friendly format offline?
CaseyB
+1  A: 

"It is difficult to do 3d triangulation". Well, that depends on what kind of triangulation you are trying to do. If you are trying, for example, to find a Delaunay triangulation, that is equivalent to finding a convex hull, which is a hard enough problem.

But you might not need something that fancy. If all you need is just any triangulation, that is simpler. But usually you need to keep track of hidden surfaces, which is another example of why they did not include this in the core API: there are too many different algorithms that might need to be used depending on the user's real requirements. They did not want to burden the resource limited mobile phone with supporting everything the developer might need, nor with a slow algorithm that would cover all bases.

Remember that when OpenGL-ES was developed, mobile phones were even more limited than now. The 16M that a G1 has was rare in those days. The CPU speed was only about 25Mhz, too.

Matt J.