POV-Ray : Newsgroups : povray.general : Check if objects intersect : Re: Check if objects intersect Server Time
30 Jul 2024 16:24:33 EDT (-0400)
  Re: Check if objects intersect  
From: SharkD
Date: 9 Nov 2008 05:25:00
Message: <web.4916b9eb205550c91da2db9f0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> In some circumstances you may be able to construct an approach using the
> min_extent and max_extent functions with the object you get by using an
> intersection of the two objects you're interested in to help determine this,
> but these functions use the bounding box of the resulting object and, as the
> help says: "this is not perfect, in some cases (such as CSG intersections
> and differences or isosurfaces) the bounding box does not represent the
> actual dimensions of the object".
>
> Given this, you could (with a considerable degree of caution) construct a
> macro that may be able to serve your particular needs by combining the
> min_extent and max_extent functions and the trace function. If the extent
> values returned are very large (10000000000), then the objects don't
> intersect. If any of the dimensions is zero, then they don't intersect.
> Otherwise you'd need to fire a grid of lines through the space using the
> trace function to see if any hit the object. If any hit the intersection
> object, then it exists. If none hit the object it's still possible that the
> original objects intersected, but that your rays were'nt close enough
> together to hit it.
>
> I've pasted in a bit of SDL below that may help if you wish to explore this
> approach.
>
> Hope that helps.
>
> Regards,
> Chris B.

Thank you very much for your excellent reply! I do not, however, want to go to
so much trouble at this time. I have decided that it is sufficient for my
purposes to approximate things by constructing "bounding spheres".

-Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.