POV-Ray : Newsgroups : povray.general : Testing whether a shape intersects with another : Re: Testing whether a shape intersects with another Server Time
31 Jul 2024 04:22:29 EDT (-0400)
  Re: Testing whether a shape intersects with another  
From: Alain
Date: 4 Nov 2007 12:31:52
Message: <472e0208@news.povray.org>
Jan Dvorak nous apporta ses lumieres en ce 2007/11/04 10:46:
> M_a_r_c napsal(a):
>> "PhilipIsPDR" <nomail@nomail> a écrit dans le message de news: 
>> web.472dcf35dc25d7085a2aacfe0@news.povray.org...
>>> Does anyone know a way of accomplishing this?  I've looked and 
>>> looked, and I
>>> realise I might be missing something very obvious...
>>>
>> What is obvious is that you did not make a research about the word 
>> "inside" in the pov documentaion :-)
>>
>> Marc
>>
> what is obvious is that you missed he doesn't test for a point. He tests 
> for an object being inside another.
> 
> One idea is to choose a point where the inner surface is seen completely 
> when unoccluded and then trace it together with the other object. If all 
> of your rays hit the object you know it's not being intersected by the 
> other object, hoping not to miss anything. Then use inside() to know 
> whether it is completely inside or completely outside. There is no 
> general algorithm to find out if two objects have non-null intersection.
The thing to do is to make two objects: one for the actual rendering, and 
another one, smaler, for the tests. If you want to fill your shape with spheres, 
like marbles in a jar, the smaller object have dimentions that are that of the 
containing object minus the radius of the spheres.

-- 
Alain
-------------------------------------------------
War is an instrument entirely inefficient toward redressing wrong; and
multiplies, instead of indemnifying losses.
Thomas Jefferson


Post a reply to this message

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