POV-Ray : Newsgroups : povray.advanced-users : bounding turbulence Server Time
24 Nov 2024 01:54:28 EST (-0500)
  bounding turbulence (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Leroy Whetstone
Subject: bounding turbulence
Date: 27 Jan 2010 23:25:26
Message: <4B611170.7090805@joplin.com>
Is there a way to calculate a bounding box for a spherical pigment
that uses turbulence?


Post a reply to this message

From: Le Forgeron
Subject: Re: bounding turbulence
Date: 28 Jan 2010 10:19:29
Message: <4b61ab01@news.povray.org>
Leroy Whetstone a écrit :
> Is there a way to calculate a bounding box for a spherical pigment
> that uses turbulence?
> 

Huh ?
Bounding boxes apply to shapes, not pigment.
Even with turbulence, the shape remains perfect.

I might not have understood the query.


Post a reply to this message

From: Warp
Subject: Re: bounding turbulence
Date: 28 Jan 2010 12:44:17
Message: <4b61ccf1@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:

> > Is there a way to calculate a bounding box for a spherical pigment
> > that uses turbulence?
> > 

> Huh ?
> Bounding boxes apply to shapes, not pigment.
> Even with turbulence, the shape remains perfect.

> I might not have understood the query.

  It would apply if he was using the pattern to create an isosurface.
It can also apply if you apply the turbulented spherical pattern to media.
I wonder if that's what he was referring to.

-- 
                                                          - Warp


Post a reply to this message

From: Leroy Whetstone
Subject: Re: bounding turbulence
Date: 28 Jan 2010 13:01:10
Message: <4B61D09F.8070104@joplin.com>
Le_Forgeron wrote:
> Leroy Whetstone a écrit :
> 
>>Is there a way to calculate a bounding box for a spherical pigment
>>that uses turbulence?
>>
> 
> 
> Huh ?
> Bounding boxes apply to shapes, not pigment.
> Even with turbulence, the shape remains perfect.
> 
> I might not have understood the query.

What I'm trying to do is scale a turbulent spherical pigment so that it 
fits into a 2 unit square on the z plane. The spherical pattern start at 
one and goes toward zero. What I want to know is a way to calculate the 
minamal point from <0,0,0> where every point farther out will be zero.
(kind of a bounding box)


Post a reply to this message

From: Le Forgeron
Subject: Re: bounding turbulence
Date: 28 Jan 2010 13:55:21
Message: <4b61dd99$1@news.povray.org>
Le 28/01/2010 18:59, Leroy Whetstone nous fit lire :
> 
> Le_Forgeron wrote:
>> Leroy Whetstone a écrit :
>>
>>> Is there a way to calculate a bounding box for a spherical pigment
>>> that uses turbulence?
>>>
>>
>>
>> Huh ?
>> Bounding boxes apply to shapes, not pigment.
>> Even with turbulence, the shape remains perfect.
>>
>> I might not have understood the query.
> 
> What I'm trying to do is scale a turbulent spherical pigment so that it
> fits into a 2 unit square on the z plane. The spherical pattern start at
> one and goes toward zero. What I want to know is a way to calculate the
> minamal point from <0,0,0> where every point farther out will be zero.
> (kind of a bounding box)
> 
> 

Could you post a scene's extract with that turbulence & pattern and the
shape/object you apply it on ?
Unless the way Warp has suggested, I'm afraid of some delusion
(comprehensible delusion due to the mesh-uber-alles approach in the
raytracing world, but delusion with povray nevertheless).


Post a reply to this message

From: Alain
Subject: Re: bounding turbulence
Date: 28 Jan 2010 16:04:57
Message: <4b61fbf9$1@news.povray.org>
Le 2010-01-28 12:59, Leroy Whetstone a écrit :
>
> Le_Forgeron wrote:
>> Leroy Whetstone a écrit :
>>
>>> Is there a way to calculate a bounding box for a spherical pigment
>>> that uses turbulence?
>>>
>>
>>
>> Huh ?
>> Bounding boxes apply to shapes, not pigment.
>> Even with turbulence, the shape remains perfect.
>>
>> I might not have understood the query.
>
> What I'm trying to do is scale a turbulent spherical pigment so that it
> fits into a 2 unit square on the z plane. The spherical pattern start at
> one and goes toward zero. What I want to know is a way to calculate the
> minamal point from <0,0,0> where every point farther out will be zero.
> (kind of a bounding box)
>
>

For a turbulence with default lambda, omega and octaves.
Just a dirty approximation:
A turbulence of 1 seems to approximatively double the extent of a 
spherical pattern, while turbulence 0.5 seems to increase it by about 50%.

It's probable that a scale by 1/(turbulence amount +1) will do the job.
Increasing any parameter will tend to increase the dimentions.


Alain


Post a reply to this message

From: Leroy Whetstone
Subject: Re: bounding turbulence
Date: 28 Jan 2010 23:18:02
Message: <4B626132.5090601@joplin.com>
Alain wrote:
> For a turbulence with default lambda, omega and octaves.
> Just a dirty approximation:
> A turbulence of 1 seems to approximatively double the extent of a 
> spherical pattern, while turbulence 0.5 seems to increase it by about 50%.
> 
> It's probable that a scale by 1/(turbulence amount +1) will do the job.
> Increasing any parameter will tend to increase the dimentions.

  That's a good start. Now what if you changed lambda, omega and octaves?
I had hope some one who say 'Oh Yes the formula is such and such'.
But I guess I'll just do some experiments to find rule of thumb formulas.


Post a reply to this message

From: Slime
Subject: Re: bounding turbulence
Date: 29 Jan 2010 00:50:25
Message: <4b627721$1@news.povray.org>
>  That's a good start. Now what if you changed lambda, omega and octaves?
> I had hope some one who say 'Oh Yes the formula is such and such'.
> But I guess I'll just do some experiments to find rule of thumb formulas.

I think the basic idea is that the sample point is moved by the value of the 
turbulence up to 'octaves' times. Each time the distance is multiplied by 
'omega'. 'Lambda' only controls the randomness of the direction each time, 
so it doesn't affect the maximum possible distance a sample point can move 
(although it can affect the average distance).

For example, for a turbulence of 1, with omega .5 and octaves 3, the maximum 
possible distance a point in the pattern can move should be 1 + .5 + .25 = 
1.75 units.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Kenneth
Subject: Re: bounding turbulence
Date: 29 Jan 2010 15:25:00
Message: <web.4b633fe55bb1469f65f302820@news.povray.org>
Leroy Whetstone <lrw### [at] joplincom> wrote:

> What I'm trying to do is scale a turbulent spherical pigment so that it
> fits into a 2 unit square on the z plane. The spherical pattern start at
> one and goes toward zero. What I want to know is a way to calculate the
> minamal point from <0,0,0> where every point farther out will be zero.
> (kind of a bounding box)

Would eval_pigment be a way to do this, inside a #while loop?  (Pure guesswork
on my part, as I *still* haven't gotten around to experimenting with eval.)

Here's some ugly sample code that I just came up with. (Others may need to check
it for any errors I've made.) Not a perfect solution--but if it *works*, then I
see all sorts of uses for it myself! The general idea is to sample your
spherical pigment in a *larger*-than-2X2 box(?) volume at lots of random points,
to eventually find the 'outer edge' of your turbulated pigment; and I guess you
would need to choose which rgb color to evaluate in order to find that distance
limit (say, the red component), assuming that you're looking for the most
distant point where red occurs. It's based on the idea that, if eval_pigment
sees no red at a particular location in space, a red value of zero is returned
for that location. So in essence, it looks for the maximum radius(?) where there
is no more red. (Of course, there may be points all *through* the turbulated
pigment where red falls to zero as well; but the code takes care of that.)

#declare S = seed(27);
#declare number_of_samples = 1000; // or some other good statistical sampling
                                   //value
#declare temp_X = 0; // to set this up as empty
#declare temp_Y = 0; // ditto
#declare temp_Z = 0; // ditto
#declare counter = 1;
#while(counter <= number_of_samples)
#declare location = <2*(rand(S) - .5),2*(rand(S) - .5),2*(rand(S) - .5)>;
//covers only the 2X2 volume--just change the multipliers to cover more space

#declare sample_value = eval_pigment(my_pigment,location) // produces a
                                      // three-component vector, I think.
#if(sample_value.red = 0) // or .x? *Any* time the red color drops to zero.
#if(temp_X < abs(location.x))
#declare temp_X = abs(location.x); // temp_X starts at zero, but will climb to
// some maximum positive value--ignoring any lower positive values each time.

#else // DON'T change 'temp_X'
#end
#if(temp_Y < abs(location.y)) // similar to above
#declare temp_Y = abs(location.y);
#else
#end
#if(temp_Z < abs(location.z)) // similar to above
#declare temp_Z = abs(location.z);
#else
#end
#else // sample_value.red does NOT equal zero, so none of the 'temp' values are
      // changed.
#end // of outer #if
#declare counter = counter + 1;
#end // of #while loop

#declare max_radius = vlength(<temp_X,temp_Y,temp_Z>);

max_radius *should* be the maximum distance (not a vector) that the red color
reaches in space--which can then be used to compute the spherical pigment scale,
to fit it into your 2X2 volume.

Ken


Post a reply to this message

From: Kenneth
Subject: Re: bounding turbulence
Date: 30 Jan 2010 12:20:00
Message: <web.4b6468a05bb1469f65f302820@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:

> ....
> #declare sample_value = eval_pigment(my_pigment,location) // produces a
>                                       // three-component vector, I think.
> #if(sample_value.red = 0) // or .x? *Any* time the red color drops to zero.
> ....

I just realized that there *might* be a problem with using this particular dot
operator syntax; perhaps changing the #if to

#if((sample_value.red) = 0) // extra parentheses

would solve it? The thing is, I don't know if eval_pigment() returns a COLOR
vector or just a 'generic' vector (or even if it's a five-component vector
rather than three.) Again, I haven't worked with eval_pigment to know anything
about these subtleties.

The documentation under "common color pitfalls" describes this situation (I
think!):

"Finally there is another problem which arises when using color dot operators in
#declare or #local directives. Consider the directive:

 #declare MyColor = rgb <0.75, 0.5, 0.75>;
 #declare RedAmt = MyColor.red;

Now RedAmt should be a float but unfortunately it is a color. POV-Ray looks at
the first keyword after the equals to try to guess what type of identifier you
want. It sees the color identifier MyColor and assumes you want to declare a
color. It then computes the float value as 0.75 then promotes that into
rgbft<0.75,0.75,0.75,0.75,0.75>. It would take a major rewrite to fix this
problem so we are just warning you about it. Any of the following work-arounds
will work properly.

 #declare RedAmt = 0.0+MyColor.red;
 #declare RedAmt = 1.0*MyColor.red;
 #declare RedAmt = (MyColor.red);
"

Ken


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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