POV-Ray : Newsgroups : povray.general : Random-Placement of Objects : Re: Random-Placement of Objects Server Time
2 Aug 2024 02:24:41 EDT (-0400)
  Re: Random-Placement of Objects  
From: Thomas de Groot
Date: 12 Feb 2005 03:39:18
Message: <420dc0b6@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> schreef in
bericht news:420a2f16@news.povray.org...
> First, initialize a random stream like this:
>
> #declare Random_Value=seed(12345);
>
> Then, whenever you need a random number between 0 and 1, use
> rand(Random_Value).
>
> Multiplying that with values and clipping it with either floor() or ceil()
> should get you integers. For example, for a random number between 10 and
20,
> do this:
> #declare Random_Number = floor(10+10*rand(Random_Value));
>
> Consult the documentation about rand() and seed() for more insight. This
> post should only get you started. :-)
>

Consider also the use of  RRand(Min,Max,Stream) where you can define your
minimum and maximum values directly.

Thomas


Post a reply to this message

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