POV-Ray : Newsgroups : povray.binaries.images : Forest generation (or; crude packing) : Re: Forest generation (or; crude packing) Server Time
11 Aug 2024 11:26:07 EDT (-0400)
  Re: Forest generation (or; crude packing)  
From: Darren New
Date: 30 Mar 2004 17:49:40
Message: <4069f984$1@news.povray.org>
Xplo Eristotle wrote:
> Because of the random nature of the code and the need to test against 
> every other tree when placing a new one,

Sounds like you may be just running linearly through your array when 
trying to place a new tree. Inserting the tree in order, then finding 
the trees to test against via binary search might work better.

For example, order by X axis, do a binary search, and only compare with 
trees within a certain distance of the same X.

Or, if you can fit (say) 20 across and 20 high, make a 20x20 array and 
only check the nearby cells for possible trees.

-- 
Darren New, San Diego CA USA (PST)
   I am in geosynchronous orbit, supported by
   a quantum photon exchange drive....


Post a reply to this message

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