![](/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) |
koos <fra### [at] hotmail com> wrote:
: I only don't get the reason why the seed declaration has to be placed
: outside the while-loop.
If you initialize the random number generator with the same value at
each loop, you'll get the same value from rand().
A line like:
#declare S = seed(0);
means: "Make S a random number stream with the initial value 0". Successive
rand(S) calls will take values from that seed (and they are always the same
values).
--
#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) |
"ingo" <ing### [at] home nl> wrote in message
news:Xns### [at] povray org...
> in news:01c1abc2$cd6f19a0$667dd383@etnica koos wrote:
>
> > Thanks, for the help. It really works!!
>
> Gaaf he.
>
Dutch?
--
#local X=20*<-2,2,5>;sphere_sweep{catmull_rom_spline 6<-8,-8>1<-8,-8>1<-8,8>1<
8,-8>1<8,8>1<8,8>1translate 20*z pigment{gradient z scale 3color_map{[0rgb<0,9
,18>][1rgb 0]}}}#local K=2*z*X-X;#local R=seed(clock);blob{#while(K.x>X.x)
#local N=X+<rand(R)rand(R)1>/3;#local X=(vlength(N-K)<vlength(X-K)?N:2*X-N);
sphere{X,1,1rotate z*90}sphere{X,1,1}#end pigment{rgbt 1}interior{media{//Nekar
emission<2,4,5>*5}}hollow scale.05}// http://nekar_xenos.tripod.com/metanoia/
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 2002/01/21
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 news:3c5d1fc1@news.povray.org Nekar Xenos wrote:
> Dutch?
>
Ja.
Ingo
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) |
Inderdaad ;-)
thanks for the explanation
In article <Xns### [at] povray org>, "ingo" <ing### [at] home nl>
wrote:
> in news:3c5d1fc1@news.povray.org Nekar Xenos wrote:
>> Dutch?
>>
> Ja.
> Ingo
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) |
"Koos Jan Niesink" <koo### [at] hotpop com> wrote in message
news:3c5e5628$1@news.povray.org...
> Inderdaad ;-)
> thanks for the explanation
>
> In article <Xns### [at] povray org>, "ingo" <ing### [at] home nl>
> wrote:
>
>
> > in news:3c5d1fc1@news.povray.org Nekar Xenos wrote:
> >> Dutch?
> >>
> > Ja.
> > Ingo
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.
I didn't see any [NE] on the povray.international so I never looked there
again...
--
#local X=20*<-2,2,5>;sphere_sweep{catmull_rom_spline 6<-8,-8>1<-8,-8>1<-8,8>1<
8,-8>1<8,8>1<8,8>1translate 20*z pigment{gradient z scale 3color_map{[0rgb<0,9
,18>][1rgb 0]}}}#local K=2*z*X-X;#local R=seed(clock);blob{#while(K.x>X.x)
#local N=X+<rand(R)rand(R)1>/3;#local X=(vlength(N-K)<vlength(X-K)?N:2*X-N);
sphere{X,1,1rotate z*90}sphere{X,1,1}#end pigment{rgbt 1}interior{media{//Nekar
emission<2,4,5>*5}}hollow scale.05}// http://nekar_xenos.tripod.com/metanoia/
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 2002/01/21
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) |
"koos" <fra### [at] hotmail com> wrote in message
news:01c1abbb$9437bf40$667dd383@etnica...
<snip>
Well, you've had answers to your initial problem.
Here's a subtler trap with random streams....
#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.
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 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) |