POV-Ray : Newsgroups : povray.newusers : rand not producing random! : Re: rand not producing random! Server Time
8 Jul 2024 02:40:11 EDT (-0400)
  Re: rand not producing random!  
From: Warp
Date: 7 Jan 2010 14:19:39
Message: <4b4633cb@news.povray.org>
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


Post a reply to this message

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