Results 1 to 7 of 7

Thread: How to triangulate.

  1. #1
    Member Contributor
    Join Date
    Jun 2002
    Posts
    50

    How to triangulate.

    Hello!

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

  2. #2
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    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. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    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. #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. #5
    Member Contributor
    Join Date
    Jun 2002
    Posts
    50

    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. #6
    Junior Member Newbie
    Join Date
    Jul 2002
    Posts
    18

    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. #7
    Member Contributor
    Join Date
    Sep 2001
    Location
    paris, france
    Posts
    73

    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).

Similar Threads

  1. triangulate collada object
    By idan in forum COLLADA
    Replies: 1
    Last Post: 08-29-2008, 02:58 AM
  2. How triangulate one NURBS surface?
    By lilyli in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-06-2004, 09:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean