POV-Ray : Newsgroups : povray.general : Q: Proximity checking : Q: Proximity checking Server Time
13 Aug 2024 03:21:10 EDT (-0400)
  Q: Proximity checking  
From: Margus Ramst
Date: 18 Nov 1998 07:07:16
Message: <01be12ec$5dfa0200$5001a8c0@e02.sise.ebs>
I hope I manage to explain this.
I am writing a macro that subdivides the object bounding box into smaller cells
and then uses trace() function to trace along 8 axes from the center of those
cells into their corners. When the object is hit, a light source is created at
the intersection point - _if_ there are no other light sources too close by.
NB! This desription is not very good, if you don't get it, skip it. Just check
the summary question at the bottom, please...

OK, I want that there are no other light sources closer than a specified
distance (to limit the overall number of light sources).
My current method is to use an array of Boolean flags (0-no light; 1-contains
light) for all cells and axes; then check the current and adjacent (already
processed) cells for light sources. If found (cell flag is 1), check the 8 axes
in that cell. The distance between the current intersection point and the found
light_source is then calculated. If the distance is smaller than the threshold
value, a new light source is created at the intersection point (and the current
cell and axis flags set to 1)
This doesn't entirely cover the method, but most of the other stuff stems
directly from those basic principles.

The macro works, but it's slow: a mere 3X3X3 division (3*3*3*8=216 traces)
takes ab. 1 min 30 to parse on my 486DX120. The first and foremost reason is my
proximity checking method.
So the question is: how can 3D proximity checking be done quicker? Would I need
to use an entirely different subdivision method (marching cubes or something)?

Margus


Post a reply to this message

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