POV-Ray : Newsgroups : povray.newusers : random elements in blob object Server Time
28 Nov 2024 05:34:59 EST (-0500)
  random elements in blob object (Message 15 to 24 of 24)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Deaken
Subject: Re: random elements in blob object
Date: 6 Feb 2002 00:41:29
Message: <3C60C261.76F55F00@sw-tech.com>
Christopher James Huff wrote:
> 
> In article <3C5FBC39.8BF959D6@sw-tech.com>, Deaken <dwy### [at] sw-techcom>
> wrote:
> 
> > Wait.  The way I'm reading this, the smaller the (absolute value of the)
> > seed is, the less the stream varies.
> 
> No, the less the seed varies, the less the stream varies (from other
> streams, not internally). Since only the first random number of each
> stream is used, this means there will be some variation, but it won't be
> random.

Okay, thanks.  That's good to know.

Just as an aside, and feel free to ignore this question, how many values
would you suggest throwing away before the streams are no longer "close"?

Deaken


Post a reply to this message

From: Tom Melly
Subject: Re: random elements in blob object
Date: 6 Feb 2002 09:34:03
Message: <3c613edb@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3c5fc0c0@news.povray.org...
> Deaken <dwy### [at] sw-techcom> wrote:
> : If I'm not, can someone post a brief summary (my C is very bad) of why
> : (computer, not design decision) this is?
>
>   Perhaps seed() takes just the integer part of the given parameter?
> (I don't know, I'm just guessing.)

Nah - it's just that the stream created with seed(0.5) is very similiar to the
stream created with seed(0.6) - well IMHO, it certainly fits the symptoms. I
fell into this trap a couple of times. It was weird, things weren't exactly
identical, but nor were they random. All streams generated by seeds within a
range of 1 are pretty similiar.

If you want to use one stream as the seed for another, do something like

 R2 = seed(rand(R1)*1000)


Post a reply to this message

From: Warp
Subject: Re: random elements in blob object
Date: 6 Feb 2002 16:11:46
Message: <3c619c12@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
:>   Perhaps seed() takes just the integer part of the given parameter?
:> (I don't know, I'm just guessing.)

: Nah - it's just that the stream created with seed(0.5) is very similiar to the
: stream created with seed(0.6) - well IMHO, it certainly fits the symptoms.

  I don't think so. If you make a simple test, you'll see that there's
absolutely no difference between seed(0), seed(0.5) and seed(0.6). I have
the strong feeling that seed() takes just the integer part of the parameter.
I can try to check this from the source code.

#declare S1=seed(0.5);
#declare S2=seed(0.6);
#declare S3=seed(0);

#declare Ind=0;
#while(Ind<100)
  #declare n1 = rand(S1);
  #declare n2 = rand(S2);
  #declare n3 = rand(S3);
  #debug concat(str(rand(S1),0,17), " ",
                str(rand(S2),0,17), " ",
                str(rand(S3),0,17), " ")
  #if(n1=n2 & n2=n3) #debug "equal\n"
  #else #debug "different\n"
  #end
  #declare Ind=Ind+1;
#end

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Warp
Subject: Re: random elements in blob object
Date: 6 Feb 2002 16:15:47
Message: <3c619d02@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
: I can try to check this from the source code.

  In express.cpp:

          case SEED_TOKEN:
            Val = stream_seed((int)Parse_Float_Param());
            break;


  I rest my case.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Ron Parker
Subject: Re: random elements in blob object
Date: 6 Feb 2002 16:18:44
Message: <slrna637dn.648.ron.parker@fwi.com>
On 6 Feb 2002 16:15:47 -0500, Warp wrote:
> Warp <war### [at] tagpovrayorg> wrote:
>: I can try to check this from the source code.
> 
>   In express.cpp:
> 
>           case SEED_TOKEN:
>             Val = stream_seed((int)Parse_Float_Param());
>             break;
> 
> 
>   I rest my case.

How do we know you didn't just make that up?  Just where is this express.cpp
anyway? :)

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

From: Warp
Subject: Re: random elements in blob object
Date: 6 Feb 2002 16:32:41
Message: <3c61a0f9@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: How do we know you didn't just make that up?  Just where is this express.cpp
: anyway? :)

  It's identical to how it's done in express.c in the POV-Ray 3.1g source
(anyone can check this), and for now you only have to trust me that this
hasn't been changed in the 3.5 source code (it can be checked when the
source is released). :)

  (Of course "you" here is in plural. Naturally you, Ron, can check it
right away. :) )

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Zeger Knaepen
Subject: Re: random elements in blob object
Date: 6 Feb 2002 17:07:21
Message: <3c61a919$1@news.povray.org>
> Dit lyk vir my daar is heelwat meer Nederlanders hier as wat ek gedink het. Ek
> vermoed hier is dalk ook 'n paar Vlaams sprekendes? Verskoon my spelling - ek
is
> Afrikaans.
Flemish is almost the same as Dutch, that's why most people refer to both
languages as Dutch. I don't really agree with this.  In my opinion, Dutch
resembles Flemish not much more than it resembles Afrikaans. (please, don't
start a discussion about it, I'm tired of those discussions...)

nog ne goeiendag!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf


Post a reply to this message

From: ingo
Subject: Re: random elements in blob object
Date: 7 Feb 2002 06:13:12
Message: <Xns91AE7C973691seed7@povray.org>
in news:3c619c12@news.povray.org Warp wrote:

> I have
> the strong feeling that seed() takes just the integer part of the
> parameter. 

I'll change that in the docs (12)

Ingo


Post a reply to this message

From: Tom Melly
Subject: Re: random elements in blob object
Date: 7 Feb 2002 08:36:05
Message: <3c6282c5$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3c619d02@news.povray.org...
>
>   I rest my case.
>

Ah! Is this intended?

My impression was wrongly formed by placing several randomly generated objects
next to each other. The different viewpoints was just enough to convince me that
there were minor differences.

Still, the original point remains, R2 = seed(rand(R1)) is still a waste of time.


Post a reply to this message

From: Warp
Subject: Re: random elements in blob object
Date: 7 Feb 2002 12:17:46
Message: <3c62b6b9@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: Ah! Is this intended?

  I would guess that the random number generator algorithm used in povray
uses just integers.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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