POV-Ray : Newsgroups : povray.newusers : Using rand(); clear howto! : Re: Using rand(); clear howto! Server Time
5 Nov 2024 13:23:05 EST (-0500)
  Re: Using rand(); clear howto!  
From: Simon Lemieux
Date: 11 May 2001 14:38:23
Message: <3AFBFA3B.330E9745@yahoo.com>
>   I think that most of us have made this kind of mistakes (or even worse)
> many times with POV-Ray, so don't feel too dumb :)
> 
>   What I really like about POV-Ray's random numbers is the fact that you
> can have several random number generators. This is usually quite difficult
> with C++ or other programming languages (unless you make your own random
> number implementation).
>   For example, suppose that you have made a little code that positions
> objects randomly in a loop and you search for an initial seed value which
> gives a nice distribution of the objects.
>   After this you get the idea that it would be nice if the objects were
> also colored randomly.
>   Oops! If you set the color of the objects randomly using the same generator
> as is used to calculate the location of the objects, the locations will
> be messed up and you will loose your nice distribution.
>   But no worries: Just use a different random number generator (even with
> the same initial seed value if you want) to color the objects. This way their
> location will be unchanged.
>   Nice.

Yeah, I see your point... It can be done too in C++, but this way is much more
easy...

-- 
+--------------------------------+---------------------------+
| Simon Lemieux                  | http://666Mhz.myip.org/   |
| Email : lem### [at] yahoocom | Povray and OpenGL Gallery |
+--------------------------------+---------------------------+


Post a reply to this message

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