|
|
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
|
|