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
28 Nov 2023 14:10:11 EST (-0500)
  Re: Need a script to randomly scatter objects vertically  
From: Mike Horvath
Date: 13 May 2021 14:24:30
Message: <609d6ede$1@news.povray.org>
On 5/13/2021 7:03 AM, Bald Eagle wrote:
> In each block of object code you can simply do a calculation on the slope to see
> if it's a good value.  If it is, you can just use another rand value and if it's
> below a certain threshold, then place your object.  #if (RandVal < 80)  object
> {Object} #end  Would place it 80% if the time.
> There's a terrain scale that gets used to adjust other calculations in the
> scene.  That ought to make the fairly code size independent.
> Looks like everything is at the origin, so you'll have to do it and then
> translate, or translate to the origin, do it, and then translate back.
> That's all I picked up / thought up on a quick read-through.

Could I create a slope map or object pigment? That would be a lot 
smoother gradient I think than doing a few checks here and there using 

I would need to feed the 3D mesh into some function or macro and get a 
2D pigment as output. Dunno how to do that.


Post a reply to this message

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