2d Polygon Intersection
I have two and more polygon.. Other polygon intersec with these polygons. I want to intersection points of the other points.
hmmm... I have a cat and there are other cats. Other cats fight with my cat. I want to intersection dogs with other dogs.
huh?
huh?
Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
reubert Wrote:huh?
Quote:Location: turkey
I've seen native speakers with less clear posts, cut the guy some slack.
reubert Wrote:hmmm... I have a cat and there are other cats. Other cats fight with my cat. I want to intersection dogs with other dogs.A point is a part of a polygon, but a dog is not part of a cat. Your analogy is therefore flawed. If you're going to slam someone for not making sense, at least make sense while doing it.
As a general answer to the question, if your polygons can be described as a set of line segments ( where a line is a->b ) it can be very simple to determine which intersect and where, simply by checking each segment against each segment.
Now, making that run quickly is an exercise up to the reader. Obvious approaches involve spatial partitioning ( to minimize the set of which lines *might* intersect others ) and boundary-box checks.
Also, if your polygons involve bezier curves, or splines or the like, it would be best to have -- if performance is an issue -- a high quality subdivision for rendering, and a low quality version for collision detection.
I have some code, if you want to see ( mine only handles beziers, though, and it's very ugly since I wrote it 6 or 7 years ago and was screwing around, but it works ).
Now, making that run quickly is an exercise up to the reader. Obvious approaches involve spatial partitioning ( to minimize the set of which lines *might* intersect others ) and boundary-box checks.
Also, if your polygons involve bezier curves, or splines or the like, it would be best to have -- if performance is an issue -- a high quality subdivision for rendering, and a low quality version for collision detection.
I have some code, if you want to see ( mine only handles beziers, though, and it's very ugly since I wrote it 6 or 7 years ago and was screwing around, but it works ).
points taken guys, my apologies bizimCity.
Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Polygon budgets | Kerome | 1 | 2,381 |
Mar 7, 2010 04:55 AM Last Post: mikey |
|
| Need ray-sphere intersection code | MattDiamond | 23 | 12,805 |
Aug 31, 2009 02:28 PM Last Post: Gengar003 |
|
| Getting the Normal for a polygon. | Jaden | 3 | 4,667 |
May 1, 2009 01:47 PM Last Post: Nosredna |
|
| Is there anything like polygon offset for GL_LINES? | TomorrowPlusX | 2 | 2,933 |
Jan 24, 2007 02:57 PM Last Post: TomorrowPlusX |
|
| Math question: deriving rotation by plane intersection | TomorrowPlusX | 6 | 3,467 |
Jan 24, 2006 07:28 AM Last Post: TomorrowPlusX |
|

