POV-Ray : Newsgroups : povray.general : Simple trick for getting different random numbers in each render : Re: Simple trick for getting different random numbers in each render Server Time
10 Aug 2024 20:57:20 EDT (-0400)
  Re: Simple trick for getting different random numbers in each render  
From: omniVERSE
Date: 30 Oct 1999 05:22:24
Message: <381ab8d0@news.povray.org>
Using a random of a already random seed() I guess.
#write(ofile,int(rand(Seed)*1000000)), where Seed is always changed to use
previously generated random number.
Although I'm unsure how this is any different from simply doing so in the
first place without having to store it externaly.  Not that I'm smart enough
to know otherwise.

Bob

Ken <tyl### [at] pacbellnet> wrote in message
news:381AB6D3.676EC919@pacbell.net...
>
>
> Nieminen Juha wrote:
> >
> >   People continously are asking for a way for getting different random
numbers
> > from render to render.
> >   Well, the solution to this is so simple that I'm ashamed of not having
> > discovered it until now.
> >
> >   Add this at the beginning of your .pov file:
> >
> > #if(file_exists("seed.dat"))
> >   #fopen ifile "seed.dat" read
> >   #read(ifile,R)
> >   #fclose ifile
> >   #declare Seed=seed(R);
> > #else
> >   #declare Seed=seed(0);
> > #end
> >
> >   Then use rand(Seed) in your pov code.
> >
> >   Then add this at the end of your .pov file:
> >
> > #fopen ofile "seed.dat" write
> > #write(ofile,int(rand(Seed)*1000000))
> > #fclose ofile
> >
> >   It's that simple. Stupid me.
>
> Which part of the above allows for a new random number each time ?
>
> --
> Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

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