|
|
I'm not sure why you would need it, but you can try this:
#declare S1=seed(1234);
#declare RS1=int(rand(Seed1)*1000);
#declare S2=seed(RS1); //This seed should now be random
If you want it to be random in each frame of an animation, you should
probably do something like this:
#declare RS=int(clock*100);
#declare Seed=seed(RS);
Margus
Steven Jones wrote in message <372387E4.4296BD07@tsn.cc>...
>Is there any way to make a random seed for the rand function?
Post a reply to this message
|
|
|
|
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
|
|