|
|
On Mon, 17 May 1999 09:47:46 +0200, Marc Schimmler wrote:
>For my next IRTC entry I need an algorithm that will allow me to check
>if two boxes occupy a common volume or not. The methods I can think of
>work only with a huge amount of plane intersections. Is there a better
>(faster) way?
Are the boxes axis-aligned? If so, a few coordinate comparisons should
be able to do the trick.
If not, are they at least aligned with each other? If so, a few
coordinate comparisons in a transformed coordinate system should do
the trick.
If they're neither, I think the plane intersections are all you have
left, as it's conceivable that two boxes could intersect yet have all
their corners on the outside of each other (though you could get away
with edge-face comparisons, which might be preferable to face-face
comparisons.) In fact, you'll still have to be careful, as it's also
conceivable that two boxes can occupy a common volume yet not intersect
at all.
Post a reply to this message
|
|