POV-Ray : Newsgroups : povray.advanced-users : Need a script to randomly scatter objects vertically : Re: Need a script to randomly scatter objects vertically Server Time
19 May 2024 23:39:00 EDT (-0400)
  Re: Need a script to randomly scatter objects vertically  
From: Thomas de Groot
Date: 20 Apr 2021 02:47:00
Message: <607e78e4$1@news.povray.org>
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 
>>> ground
>>> 3. trees are circular so the only important data is the radius of the 
>>> tree
>>> 4. the script needs to output the generated coordinates to a text file
>>> Can someone help me write such a script? Thanks!
>>> Michael
>> 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

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