POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature requests: true rand() and date() : Re: Feature requests: true rand() and date() Server Time
21 Feb 2024 23:48:05 EST (-0500)
  Re: Feature requests: true rand() and date()  
From: Chris B
Date: 4 Jan 2009 16:26:27
Message: <49612983$1@news.povray.org>
"Timo Poikola" <nomail@nomail> wrote in message 
> First of all, it will be nice if the RNG is able to generate true random
> numbers. I will be also happy if there is date() or time() or localtime() 
> or
> something mechanism which returns a timestamp.

Generally a repeatable sequence of pseudo-random numbers is far more useful 
in this type of graphics application than a non-repeatable pseudo-random 
number sequence. If you want to further randomised the sequence, for example 
to get a a different pseudo-random number stream in each frame of an 
animation, you can use the frame_number as a seed.

If you want to get access to the time or date you can already use an ini 
file option (e.g. Pre_Scene_Command or Pre_Frame_Command) to shell-out an 
operating system command that writes a date/time stamp to a file in a 
suitable format which you can then #read or #include from within your scene 
file. Then, if you want to get a non-repeatable sequence of pseudo-random 
numbers you could use some function of the time as your pseudo-random number 

If none of these meets your need it would be helpful if you could explain 
the particular situation where you believe a 'true' random number sequence 
might be of use (if it were possible to implement :-)).

Chris B.

Post a reply to this message

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