POV-Ray : Newsgroups : povray.general : Testing for intersection of two objects : Re: Testing for intersection of two objects Server Time
31 Jul 2024 22:09:54 EDT (-0400)
  Re: Testing for intersection of two objects  
From: Abe
Date: 24 Jul 2006 16:15:00
Message: <web.44c529e1c08fcd85c5588fc70@news.povray.org>
"Mike the Elder" <zer### [at] wyanorg> wrote:
> Is there a reasonably simple way in POV-Ray to produce a Boolean value
> representing whether or no two objects intersect?  As in...
>
> #if ("object{Thing1} intersects object{Thing2}")
>       // STUFF TO DO IF THEY INTERSECT
> #else
>       // STUFF TO DO IF THEY DON'T INTERSECT
> #end
>
> I would very much appreciate if some kind soul could point out the section
> of the documentation and/or available resources that deal with this issue.
>
> Thanks in advance.
>
> Mike C.

I was interested in your problem and did a couple of quick tests. Testing
min_extent and max_extent on two spheres known to intersect produced
predictable results. When the spheres did not intersect, the results for
the intersection object were as follows.

min_extent = <-10000000000.000000,-10000000000.000000,-10000000000.000000>
max_extent = <10000000000.000000,10000000000.000000,10000000000.000000>

So it looks like this could be used as a test, although I don't really know
how robust it is.

Abe


Post a reply to this message

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