POV-Ray : Newsgroups : povray.general : intersection test : Re: intersection test Server Time
30 Jul 2024 22:23:55 EDT (-0400)
  Re: intersection test  
From: Tim Attwood
Date: 14 Apr 2008 21:29:26
Message: <480404f6$1@news.povray.org>
>  If the intersection of the objects is extremely small, there's a big
> chance that your macro won't detect it.

The odds are in favor of finding a collision if it's there.
The bounding of the intersection object is used so
the volume tested can be small even though the primary
objects are large. Additionally in cases where the ratio
of intersection volume to testing volume is small the
repeated test should still find most of the collisions.
For example, if a rez of 1000 is used, then a collision
that has a ratio of 1% in the testing volume will be
detected with (1-(0.99^1000)) ~ 99.995% accuracy.

There also will never be a false collision, and if a
collision is missed it's likely to be in a "forgiving"
location where the viewer is likely to not be able to
see it.

>>       #local Pt = VRand_In_Box(Mn, Mx, S1);
>>       #local cnt = 0;
>>       #while ((result = false) & (cnt < rez))
>>          #local Pt = VRand_In_Box(Mn, Mx, S1);
>
>  Why the first Pt? It's not used anywhere.

Hmm, yeah, you're right, not sure what I was thinking,
it's been a while since I wrote it.


Post a reply to this message

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