|
![](/i/fill.gif) |
Julius Klatte wrote:
> >Is it possible to add a random +/- function to a loop ?
>
> I think so, yes.
>
> >For example I have a loop that is making several copies of
> an object
> >and I wish to apply a random rotation of say -20*y to +20*y
> as the
> >objects are being translated by the loop. Is this possible
> ?
>
> a random number is between 0 and 1, so if you want to use a
> random rotation up to twenty, you can obviously use
> 20*rand(R) to do the trick
> Now if you also wish to use negative numbers up (down?)
> to -20, you have to subtract 20,
>
> 20*rand(R)-20
>
> This 'creates' numbers between -20 and 0.
> If you want numbers between -20 and 20, it would look like
> this:
>
> 40*rand(R)-20
>
> So your rotation would be like :
>
> #declare seed(R)=1999 (happy new year)
> rotate <0,40*rand(R)-20,0>
>
> Hope this helps
>
> Julius
> http://surf.to/jkhome
Perfect ! Thank you !
--
Ken Tyler
tyl### [at] pacbell net
Post a reply to this message
|
![](/i/fill.gif) |