in news:01c1abc2$cd6f19a0$667dd383@etnica koos wrote:
> Thanks, for the help. It really works!!
Gaaf he.
> I only don't get the reason why the seed declaration has to be placed
> outside the while-loop.
#declare S= seed(7) intialises a random stream.
#declare Nr1= rand(S) takes the first random number from the stream.
#declare Nr2= rand(S) takes the second.
#declare Nr3= rand(S) the third.
Note that every time you render your scene Nr1 alway gets the same
value. Now if you put #declare S= seed(7) inside a loop, it gets
initialised every time the loop passes it. Thus the value of Nr1 will
always be the same.
Put the seed outside the loop, it is only initialised once. On the first
loop we will get the above result. On the second loop:
#declare Nr1= rand(S) takes the fourth random number from the stream.
#declare Nr2= rand(S) takes the fifth.
#declare Nr3= rand(S) the sixth.
etc.
The order of random numbers for a given seed is always the same.
Ingo
Post a reply to this message
|