POV-Ray : Newsgroups : povray.general : Testing for intersection of two objects : Re: Testing for intersection of two objects Server Time
31 Jul 2024 22:14:33 EDT (-0400)
  Re: Testing for intersection of two objects  
From: Zeger Knaepen
Date: 24 Jul 2006 15:38:45
Message: <44c521c5$1@news.povray.org>
"Mike the Elder" <zer### [at] wyanorg> wrote in message 
news:web.44c51bba804fff24aaf01cad0@news.povray.org...
> 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.

For some simple objects, this could be done, but most of the time it 
would be impossible to do accurately imho :-/
best you can do, is to check if the bounding boxes intersect

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

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