POV-Ray : Newsgroups : povray.binaries.images : seven arms : Re: seven arms (57 Kb) Server Time
31 Jul 2024 20:24:41 EDT (-0400)
  Re: seven arms (57 Kb)  
From: Alain
Date: 20 Aug 2009 09:18:18
Message: <4a8d4d1a$1@news.povray.org>

> I would also add this detail. Although:
> 
>  sphere {<0,0,0>3
>           translate x*60
>           rotate x*rand(rnd_tree)*360
>           rotate y*rand(rnd_tree)*360
>           rotate z*rand(rnd_tree)*360
>           pigment {White}
>          }
> 
> should produce the same result as:
> 
>  sphere {<0,0,0>3
>          translate x*60
>        // rotate x*rand(rnd_tree)*360
>           rotate y*rand(rnd_tree)*360
>           rotate z*rand(rnd_tree)*360
>           pigment {White}
>          }
>  the use of this first superfluous rand()  affects the values extracted by 
> the 2nd and 3rd rand(). In this case therefore we obtain values that don't 
> seem to follow any pattern.
> Be recorded as comment on the peculiarities of the rand () function and 
> nothing else.
> 
> B. Gimeno 
> 
> 
This should NOT produce the same result.

Although the first random rotate is effectively a "do nothing", it DOES 
fetch a number from the random stream.
If you remove the first rotate, the value it would have used will be 
used by the second, now first, rotate.

In the first case, you featch 3 random numbers from the stream for each 
iteration.
In the second case, you only featch 2.
Any change in the number of values accessed WILL change the end result. 
Just adding one #declare Dummy=rand(rnd_tree); will totaly change the 
result.


Alain


Post a reply to this message

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