POV-Ray : Newsgroups : povray.newusers : rand not producing random! : Re: rand not producing random! Server Time
8 Jul 2024 01:37:41 EDT (-0400)
  Re: rand not producing random!  
From: geogeo
Date: 7 Jan 2010 14:50:00
Message: <web.4b463a95cc0023fa1daa28400@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> geogeo <geo### [at] mecolcouk> wrote:
> > I am using a rand generated value 'n' but the result is always the same. I've
> > put in a text trace to output the value 'n' as follows:
>
> > #declare R1 = seed(1);
> > #declare n = rand(R1);
>
>   Well, you specified a seed of 1, and then you pull out a number from the
> RNG stream. Of course you are going to get the next number in the stream
> created with seed(1). That's by design.
>
> > //....//
> > text {
> >     ttf "timrom.ttf" str(n,0,3) 0.3, 0
> >     pigment { Red }
> >     translate<0,2,0>
> >   }
>
>   Btw, #debug exists for that exact purpose. Much easier to use.
>
> --
>                                                           - Warp

Thanks for info on #debug, had not noticed that feature, only been at this a few
days. But how do I get it to output variables? The following #debug fails:

#declare R1 = seed(1);
#declare n = rand(R1);
#debug "rand out = ",str(n),"\n";

thanks
Geo


Post a reply to this message

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