Jump to content
  • Advertisement

Archived

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

Icarus

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!