![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tom Melly wrote:
>
> #declare S1 = seed(32534);
> #while(1=1)
> #declare S2 = seed(rand(S1))
> object{foo translate y*rand(S2)}
> #end
>
> Here, you get some variation for rand(S2), but not a lot. This is because the
> seed to S2 is always in the range 0 -> 1, which returns a random stream with
> very little variation.
Wait. The way I'm reading this, the smaller the (absolute value of the)
seed is, the less the stream varies.
Please tell me that I'm misunderstanding.
If I'm not, can someone post a brief summary (my C is very bad) of why
(computer, not design decision) this is?
Deaken
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Deaken <dwy### [at] sw-tech com> 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.)
--
#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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
>
> Deaken <dwy### [at] sw-tech com> 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.)
The docs for 3.1 say that seed() takes a float. I can't find the relevant
part in the 3.5 docs.
Deaken
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3C5FBC39.8BF959D6@sw-tech.com>, Deaken <dwy### [at] sw-tech com>
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.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Christopher James Huff wrote:
>
> In article <3C5FBC39.8BF959D6@sw-tech.com>, Deaken <dwy### [at] sw-tech com>
> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Warp" <war### [at] tag povray org> wrote in message news:3c5fc0c0@news.povray.org...
> Deaken <dwy### [at] sw-tech com> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tom Melly <tom### [at] tomandlu co uk> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 6 Feb 2002 16:15:47 -0500, Warp wrote:
> Warp <war### [at] tag povray org> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ron Parker <ron### [at] povray org> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |