|
|
Norbert Kern wrote:
> Hi,
>
> I want to share the first results of my planned plant distribution tool.
Very nice.
> My idea is to use my favorite povray commands - 'trace' and 'eval_pigment'.
> For each plant a disc is defined with a cylindrical pigment. Then you search
> for neighbors by conducting traces. If you hit a neighboring disc, you check
> the pigment at this point. This way I 'linearized' the problem, at least I
> hope so.
I assume you use a union of discs and trace it. This is not really
linear but you probably reduced it to O(n*m) where only n is calculated
in interpreted code and m is in the builtin trace() (it could probably
actually be O(n*log(m)) but the bounding structures are not yet
generated at parse time AFAIK).
BTW if you generate cones/spheres instead of discs you could avoid the
additional pigment evaluation and determine the distance from the
vertical coordinate/normal.
A hardcoded implementation of this would still be way faster since you
could store the plants in a spatial data structure.
Christoph
--
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 01 Jun. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
Post a reply to this message
|
|