POV-Ray : Newsgroups : povray.advanced-users : Something more theoretical.... : Re: Something more theoretical.... Server Time
29 Jul 2024 18:18:43 EDT (-0400)
  Re: Something more theoretical....  
From: Christopher James Huff
Date: 17 Apr 2002 16:54:39
Message: <chrishuff-4912F5.15565117042002@netplex.aussie.org>
In article <3cbd31c0$1@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
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] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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