#### Archived

This topic is now archived and is closed to further replies.

# Polygon clipping.

This topic is 6938 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I was wondering if anyone knows a good way to clip a convex polygon to another polygon. Lets say you have two convex polys, poly a and poly b, and you want to clip poly a to poly b. The way I do it currently is by creating planes out of the sides of poly b and clipping a to those planes. Is there a better way? Thanks in advance.

##### Share on other sites
So no one has any other ideas of how to do this? Please respond even if it is a simple no so I can tell if people are reading this.

Thanks.

##### Share on other sites
I think people haven''t answered to your question because they don''t know of any better ways. I too don''t know of a better way, or even any other way of doing it at all.

WitchLord

##### Share on other sites
Ok, thanks for responding.

##### Share on other sites
I wish I knew how to do what you''re doing now .

##### Share on other sites
I'm not sure exactly what you have in mind, Icarus. I can imagine two cases where you might clip one poly to another:

1) if the polys are in the same plane, then its just a 2D problem.

2) if the polys aren't in the same plane, then what you're really doing is clipping "poly a" to a prism formed by "poly b". This prism would be formed exactly as you described, by making each of poly b's sides into planes (the planes would be perpendicular to poly b).

It sounds like you're interested in the 2nd case, right? I can't imagine a better method than the one you described, so I'm not much help.

I'd like to hear how you end up handling this, as I will be needing to do this for my game (projecting shadows on to ground).

Edited by - Eric on 4/27/00 4:18:36 AM

• 15
• 13
• 35
• 39