POV-Ray : Newsgroups : povray.newusers : Random Server Time
30 Dec 2024 15:09:38 EST (-0500)
  Random (Message 1 to 6 of 6)  
From: yooper
Subject: Random
Date: 16 May 2001 16:47:07
Message: <3b02e74b$1@news.povray.org>
I give up !!!
I thought I had this fingered out but . . . ?
Maybe I've been staring at it for too long 'cause no matter
how I tweek it, it seems that 2 + 2 now equals 5. ;)

I want to use three random strings . . . one for each object
so that I can alter one without changing the other two.
Here's what I have:

#declare R0 = seed(3151);
#declare R1 = seed(137);
#declare R2 = seed(1911);

and then I loop though and call these a number of times.

#declare X0=X0+(rand(R0)-0.5)*D;
#declare Y0=Y0+(rand(R0)-0.5)*D;
#declare X1=X1+(rand(R1)-0.5)*D;
#declare Y1=Y1+(rand(R1)-0.5)*D;
#declare X2=X2+(rand(R2)-0.5)*D;
#declare Y2=Y2+(rand(R2)-0.5)*D;

Now . . . I like the shape of the one using R0 and want to
keep it but would like to change those generated using R1 & R2.
When I change the seed value for R1 and/or R2, I get NO CHANGE.
The only way I get different shapes is if I change R0 . . . then all 3
are altered.  I thought that the 3 streams would be independant of
one another but they are not.

And I wanna know,  "Whatz up wid that ???" 'cause I can't see it.
I've stared at it long enough to know that I'm stuck.
And yes, I tried the POVray docs . . . ZIp, Nothing on Rand anywhere
I have looked.  I've searched these messages for "Random" messages
but haven't found any that answer the Question. What am I doing wrong?

any help will be appreciated . . . it's most likely very simple but then,
so am I ;)

Y


Post a reply to this message

From: Bob H 
Subject: Re: Random
Date: 16 May 2001 22:56:57
Message: <3b033df9@news.povray.org>
"yooper" <Out### [at] huntelnet> wrote in message
news:3b02e74b$1@news.povray.org...
>
> I want to use three random strings . . . one for each object
> so that I can alter one without changing the other two.
>
> and then I loop though and call these a number of times.

Curious, because it sometimes seems to me that random numbers have trouble
too.  I'm always juggling the things around until it works which could be
part of the reason for my thinking so.
Are those seed() statements placed together or into separate loops?  Maybe
they aren't getting accessed correctly in order to make changes when
appropriate.

Bob H.


Post a reply to this message

From: yooper
Subject: Re: Random
Date: 16 May 2001 23:44:55
Message: <3b034937$1@news.povray.org>
Are those seed() statements placed together or into separate loops?  Maybe
they aren't getting accessed correctly in order to make changes when
appropriate.

Bob H.
--------
 Yup ... they are all part of the same #while loop - recalculating the
x & y positions for the center of 3 blob components.  But it seems to
me that each call to each of them, R0, R1 & R2 should only move to
the next sequence of each random string.
  I was sure that I just read a conversation somewhere here on one of
the boards about this very thing.  I just can't find where it was or who
was discussing it.  As a matter of fact, that's what gave me the idea
to do this . . . it all made sense but . . . . ?

  As I said, the help files don't tell me anything . . . there must be some
tutorial somewhere on using rand . . . will explore.

  Thanks Bob . . . will let U know when I finger it out.

Y


Post a reply to this message

From: yooper
Subject: Re: Random Nevermind
Date: 17 May 2001 02:20:02
Message: <3b036d92@news.povray.org>
Never mind ... no problem ... I'm just a knucklehead !!!!!!
2+2=5
Seems I was using those same variables for radius values.
Duh !!!

It works . . . nothing wrong with multiple randoms . . .
nice tool to have.

Hope to have some results to pot a b.i. soon.

Y


Post a reply to this message

From: Bob H 
Subject: Re: Random Nevermind
Date: 17 May 2001 16:08:10
Message: <3b042faa@news.povray.org>
"yooper" <Out### [at] huntelnet> wrote in message
news:3b036d92@news.povray.org...
> Seems I was using those same variables for radius values.
> It works . . . nothing wrong with multiple randoms . . .
> nice tool to have.

Happens 99.9% of the time.
One place I know of that covers random number generation is the Cyclopedia
at
http://www.spiritone.com/~english/cyclopedia/rand.html

Bob H.


Post a reply to this message

From: yooper
Subject: Re: Random Nevermind
Date: 17 May 2001 16:36:01
Message: <3b043631@news.povray.org>
One place I know of that covers random number generation is the Cyclopedia
at
http://www.spiritone.com/~english/cyclopedia/rand.html

Bob H.
****
Thanks Bob ... I've got a pretty good handle on it ... that's what waz
frustrating about not having it work ... I thought the whole thing out
the day B4 and wrote the code for it just fine . . . so I'm pleased to
find that the problem wasn't one to do with Random.  Just forgot I had
those variables already in use.  2+2=5

Y


Post a reply to this message

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