POV-Ray : Newsgroups : povray.documentation.inbuilt : (seed) could use a better explanation : Re: (seed) could use a better explanation Server Time
20 Apr 2024 07:45:29 EDT (-0400)
  Re: (seed) could use a better explanation  
From: Warp
Date: 7 Oct 2005 16:26:02
Message: <4346d9d9@news.povray.org>
Kenneth <kdw### [at] earthlinknet> wrote:
> 2) When invoking SEED, does POV first create ONE SINGLE LONG psuedo random
> stream of numbers (the "random" values of which depend on the host computer
> and OS it's running on)? And does the individual number then placed into
> SEED simply choose a different LOCATION within this single long stream, for
> RAND to start with?

  Although povray does not create a concrete stream of numbers, that
explanation is technically correct (except that the values do not depend
on the platform).

  One could say that POV-Ray uses a fixed list of 2^32 pseudorandom numbers,
and seed() simply chooses where to start reading numbers from this list.
One could think of it as a starting index (eg. like "start reading numbers
from position 100 forward in the list).

  Naturally POV-Ray doesn't have this list of numbers stored in memory
(it would require prohibitive amounts of memory) but the items in the list
are created on the fly with a simple (yet cryptographically rather good)
formula as needed.

  As mentioned, that formula is platform-independent, so you will always
get the same numbers in all platforms.

  However, these are rather low-level details of the implementation of
the random number generator. You certainly don't need to know this in
order to use them.

-- 
                                                          - Warp


Post a reply to this message

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