[gameprogrammer] Re: poly fill
- From: "Justin Coleman" <jmcoleman@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sat, 31 Mar 2007 13:14:51 -0500
If it's guaranteed to be convex, you could make a fan by starting at
one vertex, and making a triangle with that and the next two vertices
(1-2-3), then moving around the poly (1-3-4, 1-4-5, 1-5-6, etc) until
you hit all the vertices. That will give you a set of triangles that
will completely fill the poly.
If it's not guaranteed to be convex, split it until it is, and then
fan the result polys.
http://www.mathopenref.com/polygonconvex.html may help you visualize
how to split.
On 3/31/07, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
Hey guys,
I've been given the task of taking a generic polygon and filling it.
The polygon is described as a set of lines and may be concave or
convex, but one thing that is nice is that it's garaunteed not to
cross over itself.
I read up a way to do this with scan lines but unfortunately I have to
use 3d graphics primitives (qauds, triangle fans etc) to fill in this
polygon, so I can't do it that way :P
Does anyone have any clues on how to do this?
Thanks!
Alan
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] poly fill
- From: Alan Wolfe
Other related posts:
- » [gameprogrammer] poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
- » [gameprogrammer] Re: poly fill
Hey guys, I've been given the task of taking a generic polygon and filling it. The polygon is described as a set of lines and may be concave or convex, but one thing that is nice is that it's garaunteed not to cross over itself. I read up a way to do this with scan lines but unfortunately I have to use 3d graphics primitives (qauds, triangle fans etc) to fill in this polygon, so I can't do it that way :P Does anyone have any clues on how to do this? Thanks! Alan --------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- [gameprogrammer] poly fill
- From: Alan Wolfe