POV-Ray : Newsgroups : povray.general : trees again : Re: trees again Server Time
26 Sep 2024 17:45:33 EDT (-0400)
  Re: trees again  
From: stbenge
Date: 6 Aug 2010 00:27:46
Message: <4c5b8f42$1@news.povray.org>
Anthony D. Baye wrote:
> Supposing that a tree generation macro took in a location, the age of the tree,
> and an array of elements to test against, how hard would it be to grow a tree in
> a given location, accounting for interference from the listed elements?

Testing against a list of successful branch objects and performing 
inside/outside/trace operations on all of them can become very slow.

You may be able to create a 3D array that is the space in which the tree 
grows. Each time a branch is made, fill that part of your 3D array in 
with positive values. Wherever a new branch is supposed to go, test 
against the cells in that area. If the cells are 0, then your branch can 
go there.

If you can get away with a low-res array, then this method should be 
pretty fast to compute as you just need to test against (and write to) a 
shared space. But there will be some trickery involved when 
approximating each branch as a voxel representation... To get something 
like this to work, you might want to find out how to make Bresenham 
lines in 3D space, particularly ones with variable padding.

Sam


Post a reply to this message

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