POV-Ray : Newsgroups : povray.advanced-users : Bounding with a sky_sphere : Re: Bounding with a sky_sphere Server Time
30 Jul 2024 10:11:43 EDT (-0400)
  Re: Bounding with a sky_sphere  
From: Chris Huff
Date: 18 Feb 2000 11:51:44
Message: <chrishuff_99-96E51F.11525818022000@news.povray.org>
In article <38AD605D.D9C23B5A@peak.edu.ee>, Margus Ramst 
<mar### [at] peakeduee> wrote:

> Chris Huff wrote:
> > 
> > Have you tried bounding in a tree-like structure?
> 
> Any ideas how to construct such a tree structure in POV script?
> Let's say I have a set of points, which I would like to sort into 
> distance-based
> subsets. How could I do this efficiently, i.e. without comparing every 
> point to
> every other point? An oct-tree? But how?

A tree of unions is the eay I would do it:
union {
   union {
      union {
         union {}
         union {}
      }
      union {
         union {}
         union {}
      }
   }
   union {
      union {
         union {}
         union {}
      }
      union {
         union {}
         union {}
      }
   }
}

You might be able to make a macro which takes an array of objects as 
well as an array of their center positions and sorts them out into this 
tree structure. If you use MegaPOV, with min_extent and max_extent, the 
second array would be unnecessary.
But there are probably better ways to do this. It isn't my idea, there 
were some discussions in these newsgroups a while ago about it...

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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