POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature requests: true rand() and date() : Re: Feature requests: true rand() and date() Server Time
5 May 2024 09:44:40 EDT (-0400)
  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 
news:web.496116dc7e5264fe3332e10f0@news.povray.org...
> 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 
seed.

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 :-)).

Regards,
Chris B.


Post a reply to this message

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