POV-Ray : Newsgroups : povray.general : Is it me or does rand(n) loop ? : Re: Is it me or does rand(n) loop ? Server Time
5 Aug 2024 02:17:25 EDT (-0400)
  Re: Is it me or does rand(n) loop ?  
From: Christopher James Huff
Date: 18 Dec 2002 12:41:22
Message: <chrishuff-714D01.12362618122002@netplex.aussie.org>
In article <web.3e00a576fc9687d9f765b2b40@news.povray.org>,
 "BlackRose" <nomail@nomail> wrote:

> (yeah I know it's not real pov code, but...)

Without real POV code, there is little anyone can do. What do you expect 
this to be useful for?


> Anyways, it seemed that no matter what bounds I used, I was getting square
> grids of objects (instead of the randomly placed ones I wanted). Upon
> debugging, I found that (atleast to 5 decimal places) the values popped out
> by a particular rand stream repeated (which is not what I had expected.
> BTW, I'm doing this on a winXP machine, with pov version 3.5...

Pseudorandom numbers do repeat, but the period is very large. If you are 
seeing repetition, you are probably using the rand() function wrong. 
Give the real code, trimmed down to the minimum required to demonstrate 
the problem, but check the documentation first.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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