1. ## How to triangulate.

Hello!

I'm having polygon with > 3 vertexes, How could i make it bunch of triangles?

2. ## Re: How to triangulate.

I have had great luck with the GPC (Generic Polygon Clipping) library. I believe it also does triangulation. Why code something like this when you can just use the code?
http://www.cs.man.ac.uk/aig/staff/al...re//index.html

3. ## Re: How to triangulate.

You need help drawning more then one triangle?
Not sure what you are asking for.

Originally posted by runggu:
Hello!

I'm having polygon with > 3 vertexes, How could i make it bunch of triangles?

4. ## Re: How to triangulate.

One (not optimal) way which always works:
Create a new vertex in the middle of all vertices. Draw all triangles using 2 neighbouring vertices and the middle vertex.

What you can also do is choose one vertex of the polygon as the *central* vertex, and draw using 2 adjacent vertices and the chosen vertex

5. ## Re: How to triangulate.

I know how to draw more than one triangle, i just want to know how to complex polygon to bunch of simple ones.

edotorpedo: That doesn't work with reaally complex polygons(like shape of G)

6. ## Re: How to triangulate.

Use a tesselation object. It's made for just that cause: tesselation is triangulation.
Go look for gluNewTess() in the SDK

Ciao,

Niftybitz.

7. ## Re: How to triangulate.

this is a classical computational geometry problem. look for "polygon triangulation" on google.
The basic idea of the common algorithm is to make trapezoids with your polygon, then cuting trapezoids accordingly (cut it in half anywhere if all its vertices are convex, otherwise cut it at the non-convex vertex). This works, providing your polygon is "simple" enougth (the G shape is).

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•