POV-Ray : Newsgroups : povray.newusers : seed and rand : Re: seed and rand Server Time
2 Nov 2024 03:15:00 EDT (-0400)
  Re: seed and rand  
From: regdo
Date: 9 Oct 2004 16:35:01
Message: <web.41684a61124fa141ed8cdc490@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> Are you doing it like this?
>
> #declare mySeed = seed(123);
>
> ...
>
> #declare randomNumber = rand(mySeed);
>
> The important thing here is that you pass the seed variable into the rand
> function.
>
>  - Slime
>  [ http://www.slimeland.com/ ]

I do use it like this. The behaviour I've seen is that if I have :
#declare Rnd=seed(0);
#declare Rnd1=seed(1)
....much code here using Rnd...
#declare x=rand(Rnd1)

i get an x that is equal to a fixed value whatever I pass as a parameter if
the second seed() statement.
If I move it just before I use it, it works fine. That is what I don't
understand, because I thought that random number streams were totally
independant.
Any idea ?


Post a reply to this message

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