Op 20/04/2021 om 08:10 schreef Thomas de Groot:
> Op 20/04/2021 om 06:05 schreef Mike Horvath:
>> On 4/20/2021 12:02 AM, Mike Horvath wrote:
>>> I have some mesh based terrain model. I would like to drop trees
>>> vertically on to it based on some rules:
>>> 1. the trees should not overlap with each other
>>> 2. the tree density should depend on the (configurable) slope of the
>>> 3. trees are circular so the only important data is the radius of the
>>> 4. the script needs to output the generated coordinates to a text file
>>> Can someone help me write such a script? Thanks!
>> Oops, also this:
>> 5. there are multiple types of trees with varying probability of occuring
> I have such a script!
> I shall send you the details later today.
That "later today" was sooner than expected.
In the attached zip file are three POV-Ray codes:
1) the original code by Kirk Andrews which you can use as reference
2) my own code based on (1) where I have added and/or changed a couple
of things. This code I use currently for any landscape, whether they are
trees or rocks or whatever (My objects poser.pov)
3) My own code for trees, with probability added for different types of
trees (My tree poser.pov)
They do not answer /all/ your conditions maybe, but come very close
indeed. I think you can improve where necessary :-)
If in doubt, please yell.
Post a reply to this message