POV-Ray : Newsgroups : povray.documentation.inbuilt : (seed) could use a better explanation : Re: (seed) could use a better explanation Server Time
25 Apr 2024 16:04:12 EDT (-0400)
  Re: (seed) could use a better explanation  
From: Kenneth
Date: 7 Oct 2005 18:30:00
Message: <web.4346f5e06c2f1bf6844fe410@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:


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

Thanks!  That clears up all my questions. (And would be a good addition to
the POV docs!)


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

Actually, I think there *might* arise situations where the knowledge of how
SEED works could prevent confusion in the visual apprearance of a scene.

Let's see if I can phrase this correctly:  Say you choose SEED(432) to
initialize your first random number process. Then the first "random" number
that RAND chooses from that will be, let us say, .36547 (not really, that's
just a guess.) And the next "random" number that RAND chooses will be, let
us say, .85645.  Fine and dandy, so far. NOW, if you then, without
thinking, choose to initialize a new SEED as SEED (433) -- i.e., only one
integer number away from your first SEED value-- then the very first
"random" number that this new SEED's RAND function will choose will be, lo
and behold, .85645---the very same "random" number that the FIRST SEED's
2nd RAND  function returned!  Am I making sense? I can think of an example
(untried) where this might look odd: Create an orderly row of 20 simple
objects, each randomly colored using my 1st SEED value.  Then create a 2nd
row of 20 objects, right behind the first and lined up with it, but
randomly colored using my 2nd  SEED value.  The visual appearance would be
that the "random" colors for each row would be *almost* the same, offset by
only ONE color!

At least, that's my conceptual understanding of what would happen.

If my thinking is correct, this is wholly different behavior than if SEED
created completely *new and different* random number streams for each and
every number that was placed into it.


Post a reply to this message

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