Skip to main content
gamedev.net
🔒 Locked

Polygon clipping.

Started by Icarus Apr 21, 2000 at 1:06 AM 4 replies 600+ views
Original Post
Icarus
Icarus
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.
-Andreas
Icarus
Icarus
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.
-Andreas
WitchLord
WitchLord
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
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel
Icarus
Icarus
Ok, thanks for responding.
-Andreas
WhatEver
WhatEver
I wish I knew how to do what you''re doing now .
Eric
Eric
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.