POV-Ray : Newsgroups : povray.newusers : Better way to make random sequence Server Time
4 Nov 2024 17:29:40 EST (-0500)
  Better way to make random sequence (Message 1 to 4 of 4)  
From: Bryan Heit
Subject: Better way to make random sequence
Date: 3 Dec 2004 12:49:44
Message: <41b0a738$1@news.povray.org>
I'm trying to create a scene which relies on the random placement/sizing 
of blobs to form "rough ground".  Unfortunately, the random number 
generators in Povray aren't very random (if I'm reading the help file 
correctly there is just a random series of numbers that the system runs 
through).  Any ways, as a result of this a pattern forms in the 
topography that I am generating, and that is exactly what I'm trying to 
avoid.  Has anyone out there figured out a better random-number 
generator, or know of a way in which I can make pov-rays random number 
generator a little more random.  Any advice (macro, code, formula or 
even just ideas) is appreciated. . .

Thanx in advance

Bryan


Post a reply to this message

From: Christoph Hormann
Subject: Re: Better way to make random sequence
Date: 3 Dec 2004 13:50:02
Message: <coqcg2$gip$1@chho.imagico.de>
Bryan Heit wrote:
> I'm trying to create a scene which relies on the random placement/sizing 
> of blobs to form "rough ground".  Unfortunately, the random number 
> generators in Povray aren't very random (if I'm reading the help file 
> correctly there is just a random series of numbers that the system runs 
> through).  Any ways, as a result of this a pattern forms in the 
> topography that I am generating, and that is exactly what I'm trying to 
> avoid.  Has anyone out there figured out a better random-number 
> generator, or know of a way in which I can make pov-rays random number 
> generator a little more random.  Any advice (macro, code, formula or 
> even just ideas) is appreciated. . .

First of all any random number generator is just a random series of 
numbers that repeat after some time.  Of course the POV-Ray rand() 
function is not a very good one since like most simple random number 
generators it calculates the next random number from (and only from) the 
last one.  Still it is unlikely (but not impossible) that a regularity 
you see is caused by the rand() function.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tom Melly
Subject: Re: Better way to make random sequence
Date: 3 Dec 2004 16:29:45
Message: <41b0dac9$1@news.povray.org>
"Bryan Heit" <bjh### [at] nospamucalgaryca> wrote in message
news:41b0a738$1@news.povray.org...

> Thanx in advance

I'd go with Chris on this one - and add that you should post your code. It's
easy to make mistakes with pov random number generator code that results in
regularity.


Post a reply to this message

From: Loki
Subject: Re: Better way to make random sequence
Date: 7 Dec 2004 10:55:00
Message: <web.41b5d1ead6721fe841ff36a70@news.povray.org>
You might want to adapt a more robust random stream generator if the rand()
stream is really causing you the problem.  The book "Numerical recipes in
C" has a routine for a much better (best?) uniform random deviate generator
which I have used extensively in computer simulations though never adapted
to POV's SDL.

L
-


Post a reply to this message

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