Re: How to get trinagles from a polygon?

From: ZMan (news-replies_at_thezbuffer)
Date: 07/09/04


Date: Thu, 8 Jul 2004 17:21:34 -0700

For arbitrary triangles there are a lot of non trivial algorithms you can
find with google:

http://www.google.com/search?hl=en&ie=UTF-8&q=polygon+triangle+algorithm&spell=1

You might find the code already written in David Ebberleys archive
http://www.magic-software.com/Geometry.html - I don't have time to go
through the code. He has an algorothm in there for testing convexity
    // Test for convexity: This function will iterate over the edges of the
    // polygon and verify for each that the polygon vertices are all on the
    // nonnegative side of the line. The threshold is the value that the
line
    // distance d is compared to, d < 0. In theory the distances should all
    // be nonegative. Floating point round-off errors can cause some small
    // distances, so you might set fThreshold to a small negative number.
    bool ValidateHalfSpaceProperty (Real fThreshold = (Real)0.0) const;

"Michel Walsh" <vanderghast@VirusAreFunnierThanSpam> wrote in message
news:%23uLznzSZEHA.712@TK2MSFTNGP11.phx.gbl...
> Hi,
>
>
> If the (in plane) polygon is concave, start at a vertex and read the
> other vertexes in succession (clock wise or anti-clock wise, dependant of
> the desired culling) as a fan-list of triangles. That's all.
>
> If it is convex, the previous process will generally fails (it may
> works
> on some special cases), but you may find it is preferable to get a way to
> divide the original convex polygon into 2 or more concave polygons, and
> then, to apply the previous process.
>
>
>
> Hoping it may help,
> Vanderghast, Access MVP
>
>
>
> "Dei" <daniel@leap.is.pcnet.ro> wrote in message
> news:e1G367PZEHA.1448@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> I have a polygon and I want to split it in triangles. I couldn't find any
>> function for this. I think there is such a function in OpenGL
>> "gluTessVertex" but I need one in DirectX.Managed.
>>
>> Thanks,
>> Daniel
>>
>>
>
>



Relevant Pages

  • Re: How to get trinagles from a polygon?
    ... other vertexes in succession (clock wise or anti-clock wise, ... the desired culling) as a fan-list of triangles. ... > I have a polygon and I want to split it in triangles. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: outline polygon of overlapping triangles
    ... where I can get an algorithm that creates ... If you want the polygon that is the union of the ... triangles, the suggestion to use Alan Murtha's ...
    (comp.graphics.algorithms)
  • Re: From Triangle tiles to convex Polygons.
    ... I start out with a complicated non-convex polygon with holes. ... it into OpenGL GLU, and I get back a few hundred triangles that ... problem is that a few hundred triangles is way too many, ... I think you can do this by taking your triangulation and merge triangles to build multiple convex polygons from it. ...
    (comp.graphics.algorithms)
  • Re: Uniformly Distribute Points inside Polygon
    ... With the meshgrid, I ... won't know how many points will fall into the polygon beforehand. ... Since you are still interested in filling triangles, I thought I would fix up ... It is not an absolutely uniform filling in the sense of, say, packing spheres ...
    (comp.soft-sys.matlab)
  • newbie-alert! Polygons
    ... I'm about to write a code that draws a polygon in directX 9. ... 2d vectors) are going to be split into into primitive triangles. ... One convex point in the polygon makes a good startingpoint for drawing ... point, check weather the mid-point-normal is ok, draw the triangle (if ...
    (comp.graphics.algorithms)

Loading