|
![](/i/fill.gif) |
In article <38AD605D.D9C23B5A@peak.edu.ee>, Margus Ramst
<mar### [at] peak edu ee> 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] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |