POV-Ray : Newsgroups : povray.documentation.inbuilt : (seed) could use a better explanation : Re: (seed) could use a better explanation Server Time
29 Apr 2024 05:34:31 EDT (-0400)
  Re: (seed) could use a better explanation  
From: Kenneth
Date: 27 Oct 2005 16:20:00
Message: <web.4361355d6c2f1bf71fa4210@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> ...I think I'll try my own hand at coming up with some meatier
> explanations. If  I manage to do so, I'll post them for vetting.
>

I hereby offer alternate wordings of POV's definitions
(hopefully more English-friendly), specifically for new users -- those who
are just coming across the definitions for the first time. Personally, I
see a need for that. I've shamelessly borrowed from all that has been
posted here, but the paraphrasing is my own, so I'm the only one to blame
if something isn't correct.
-----
SEED(I)   Works together with RAND, for the creation of random values.  From
any integer value placed into it, SEED() effectively creates a long
pseudo-random stream of individual numbers, each between 0 and 1 inclusive.
 The integer can range from 0 up to 4294967295  (i.e., 2 ^ 32 - 1.) A float
is allowed, but will be truncated to an integer.  Each and every value will
effectively produce a completely different stream.  (Though not technically
correct, the end result is practically the same.) Each subsequent call from
RAND will then "withdraw" a different value from this stream.  SEED (I)
must first be initialized (#declared) as a variable before RAND can call on
it. Any number of streams can be initialized in your scene's code.

RAND(V)  Works together with SEED. Each time RAND() is called -- using
SEED's #declared variable name -- a pseudo-random float value is
"withdrawn" from the SEED stream, in the range of 0 to 1 inclusive. This
process is itself psuedo-random; each RAND() call will "jump" all over the
entire stream to choose a value. The two working together produce a good
approximation of randomness.  This random number creation is independent of
the computer platform or OS; for any integer placed into SEED(), the exact
same stream -- as well as its RAND() value(s) -- will be returned,
regardless of computer platform. This allows scene files to be rendered
identically on different platforms.

-------
Perhaps a bit wordy, but,...is this more clear? Less clear? The same?

I invite comments, criticisms, additions or further clarifications.

Ken


Post a reply to this message

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