POV-Ray : Newsgroups : povray.general : QUESTION: Random Seed deriving from Time? : Re: QUESTION: Random Seed deriving from Time? Server Time
26 Apr 2024 21:24:38 EDT (-0400)
  Re: QUESTION: Random Seed deriving from Time?  
From: Sven Littkowski
Date: 18 Feb 2018 21:45:58
Message: <5a8a3a66$1@news.povray.org>
On 18.02.2018 21:22, clipka wrote:
> Am 18.02.2018 um 22:24 schrieb Sven Littkowski:
>> I am trying this
>> #declare MyRandomer   = seed(CURRENTTIMESTAMP);
>>
>> and this
>> #declare MyRandomer   = seed(msg:CURRENTTIMESTAMP);
>>
>> but only errors. please assist. Thanks!
> 
> Out of pure curiosity: How did you come up with that particular syntax?
> 
> 
> The keyword you're looking for is `now`, which returns the time elapsed
> since 2000-01-01, 00:00:00 GMT, in (fractional) days.
> 
> Note that since `seed()` converts its parameter to an integer, you need
> to scale the result of `now` to whatever granularity you need for the
> seed. For instance, for the seed to change every hour, use:
> 
>     #declare MyRandomer = seed(now * 24);
> 
> Note that the value of `now` changes even during parsing.
> 
> Also note that the resolution of the underlying timer may vary between
> systems, and may be as poor as a second per tick.
> 
> 
> Finally, due to the nature of the inbuilt random number generator, the
> first few values pulled from the generator may remain somewhat similar
> between consecutive seeds, so you may want to choose your granularity
> somewhat higher than absolutely necessary, or always discard the first
> few random numbers (maybe a dozen or so) pulled from the generator.
> 
Hi.

The POV-Ray help file did not mention "now", and so I started to search
online but without knowing what exact keywords to look for. Eventually,
I came accross a web page thatwas about POV-Ray and also featured
"CURRENTTIMESTAMP". I believed it was more about programming then
anything I could use in a scene, but i wanted to give a try, and that's
how I got these variations you saw.

I use "now" but the renders still look the same, like the seed would
remain the same. I make the renders in intervals of less than a minute.
Thus, a seed that changes each second would be nice.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

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