POV-Ray : Newsgroups : povray.programming : Seed() Rand() Server Time
29 Jul 2024 06:17:23 EDT (-0400)
  Seed() Rand() (Message 1 to 2 of 2)  
From: Bjorn Hellqvist
Subject: Seed() Rand()
Date: 23 Mar 1998 21:38:35
Message: <35171CAB.1988E0CC@stockholm.mail.telia.com>
Ok can someone explain how
Seed() and Rand() works. 

It seems not to work the way i wanted it to work. 

short cuts of the script. 

#declare RndNo=Seed(123)

#while (foo > 0)
	#declare Rnd=rand(RndNo)
	#if (rnd <= 0.1)
		//do the stuff
	#end
	#if (0.1 < Rnd <= 0.2)
		//do some other stuff
	#end
	...
	...
#end

it seems to goto just one of the if statement.

/Thanks Bjorn Hellqvist
	// Sweden


Post a reply to this message

From: Bjorn Hellqvist
Subject: Re: Seed() Rand()
Date: 23 Mar 1998 22:03:36
Message: <35172288.A7743097@stockholm.mail.telia.com>
Bjorn Hellqvist wrote:
> 
> Ok can someone explain how
> Seed() and Rand() works.
> 
> It seems not to work the way i wanted it to work.
> 
> short cuts of the script.
> 
> #declare RndNo=Seed(123)
> 
> #while (foo > 0)
>         #declare Rnd=rand(RndNo)
>         #if (rnd <= 0.1)
>                 //do the stuff
>         #end
>         #if (0.1 < Rnd <= 0.2)
>                 //do some other stuff
>         #end
>         ...
>         ...
> #end
> 
> it seems to goto just one of the if statement.
> 
> /Thanks Bjorn Hellqvist
>         // Sweden


I found the answer myself.. =)


Post a reply to this message

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