POV-Ray : Newsgroups : povray.newusers : seed and rand : seed and rand Server Time
2 Nov 2024 03:14:25 EDT (-0400)
  seed and rand  
From: regdo
Date: 9 Oct 2004 13:05:00
Message: <web.416819786f2b8ebe68d83220@news.povray.org>
Hi.
By the documentation, I understood that the seed function initializes a
stream of random numbers, which is independant with others.
Obviously, it is not true :
I have a scene in which I place objects randomly.
In my scene I first have declarations, then positionning.
So I have 3 seed() functions at the beginning of the code, and I use the
third one at the end. The problem : changing the number specified in the
seed function changes nothing. Using the debug function showed me that the
random numbers are strictly identical whatever seed I use.
Now if I move the seed statement and put it just before the rand function is
used, I have something completely different.
Conclusion : the seed/rand functions are intimately connected, and the use
of one stream visibly "corrupts" the others.
Can anyone tell me why I have not the same result when I put the seed in the
beginning of the code or just before using the stream ?


Post a reply to this message

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