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
10 Dec 2023 12:02:46 EST (-0500)
  Re: Need a script to randomly scatter objects vertically  
From: Alain Martel
Date: 12 May 2021 10:19:27
Message: <609be3ef$1@news.povray.org>

> I finally got around to this. Thanks!
> I don't quite understand the code yet. A few questions:
> 1. How do I make it so that the probability is lower depending on the

> 2. The spikes seem to point in the direction of the normal. Can I

> 3. Is there a way to round the y coordinate to the nearest 8 units and

> Thanks again!
> Michael
For the spikes. You just need to ignore the normal returned by the trace 
function when placing them.
So, remove any vrotate or vorient.

For the rounding... I would try using the modulo function.
Something like this :
#declare LEGO_Position = <Position.x-mod(Position.x, 10), 
Position.y-mod(Position.y, 8), Position.z-mod(Position.z, 10)>

Post a reply to this message

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