POV-Ray : Newsgroups : povray.newusers : seed : Re: seed Server Time
5 Sep 2024 18:16:59 EDT (-0400)
  Re: seed  
From: Chris Huff
Date: 24 Feb 2000 08:08:06
Message: <chrishuff_99-3AA9E6.08093024022000@news.povray.org>
In article <38B52852.548D6481@via.ecp.fr>, Jean-Michel Grimaldi 
<jm### [at] viaecpfr> wrote:

> Yes, and thus your image will always render the same.
> As for the initial question, do the following :
>  s = seed(1234) ;
>  [...] A+random(s) [...]
> This way you will get a number between A and A+1.
> And if the result is not satisfying, just change 1234 into something
> else.

Not "random()", "rand()". But this gives me an idea...

#macro random(Sd, Mn, Mx)
   (rand(Sd)*(Mx-Mn) + Mn)
#end

Now, this should let you use "random(stream, min_limit, max_limit)" for 
your random numbers, where stream is the variable initialized by seed(). 
The other two should be pretty explanatory.
I haven't had time to test it though. :-)

#declare S = seed(589743);
sphere {< random(S,-1, 2), 0, 0>, 0.1}

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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