|
![](/i/fill.gif) |
In article <3cbd31c0$1@news.povray.org>, "Jan Walzer" <jan### [at] lzer net>
wrote:
> in POV-SDL ? ...
>
> I've thought about this, but I dunno how I could
> do this, if I haven't some kind of "references"
You can use unions to group objects, and you can put unions inside
unions.
Assuming you have a line of 16 objects like this:
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P
Split it into two groups, put each into a union and make a union of the
unions. Split each sub-union the same way.
The resulting structure would be like:
union {
union {
union {
union {A, B},
union {C, D}
},
union {
union {E, F},
union {G, H}
}
},
union {
union {
union {I, J},
union {K, L}
},
union {
union {M, N},
union {O, P}
}
}
}
This basically makes POV do a binary search through the objects instead
of brute-force testing all of them. I used a line for simplicity, but
the technique could be used for 2D and 3D grids or other structures.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |