POV-Ray : Newsgroups : povray.general : Rand function : Re: Rand function Server Time
14 Nov 2024 23:19:34 EST (-0500)
  Re: Rand function  
From: Nieminen Mika
Date: 26 Apr 1999 12:43:19
Message: <37248997.0@news.povray.org>
Margus Ramst <mar### [at] peakeduee> wrote:
: #declare S1=seed(1234);
: #declare RS1=int(rand(Seed1)*1000);
: #declare S2=seed(RS1); //This seed should now be random

  Nope. S2 is exactly as random as S1 (ie. it will always have the same
value). I think that what he meant is a random value which changes from
run to run (like srand(time()) in C).
  AFAIK there's no way to achieve this directly with povray.
  Perhaps one solution is to make a small program which writes the current
time in seconds to a file and then reading that value with the #read function
in povray.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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