|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
This one's had me stumped for a few weeks...
I'm trying to get the amplitude of the ripples to decay in both the x and z
directions. In the attached image, I've only achieved the decay in the
x-direction. (and growth in the z?)
It's probably something really simple that I've 'overlooked'...
Here's the code I'm using:
//pov code
#declare k = 2;
#declare h1 = 1/2;
#declare pos1 = <1/8,0,1/8>;
#declare fn_1 =
function {
pattern {
ripples
frequency 0.75
scale 0.1
translate <pos1.x,1-pos1.z,pos1.y>
}
}
#declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*x) ) }
height_field {
function 400,400 {fn_water(x,y,0)*0.25 + 0.5}
smooth
pigment {Red}
}
//end code
thanks
jim
Post a reply to this message
Attachments:
Download 'hf_new.png' (36 KB)
Preview of image 'hf_new.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Change
#declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*x) ) }
to
#declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*sqrt(x^2+y^2)) ) }
And the exponential falloff will be dependant on the overall distance from
the origin, rather than just the distance along the x axis.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks, but that doesn't seem to work - it just produces the same result as
before.
Anyway I can see now that the value is dependant on the "overall" distance
so I'll keep experimenting...
Thanks
Jim
"Slime" <slm### [at] slimelandcom> wrote in message
news:3ce03d2f$1@news.povray.org...
> Change
>
> #declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*x) ) }
>
> to
>
> #declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*sqrt(x^2+y^2)) ) }
>
> And the exponential falloff will be dependant on the overall distance from
> the origin, rather than just the distance along the x axis.
>
> - Slime
> [ http://www.slimeland.com/ ]
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Slime" <slm### [at] slimelandcom> wrote in message
news:3ce03d2f$1@news.povray.org...
> Change
>
> #declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*x) ) }
>
> to
>
> #declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*sqrt(x^2+y^2)) ) }
>
> And the exponential falloff will be dependant on the overall distance from
> the origin, rather than just the distance along the x axis.
>
> - Slime
> [ http://www.slimeland.com/ ]
>
>
figured it...for reasons beyond my comprehension, all y values actually need
to be (1-y), hence the function is:
#declare fn_water = function {h1 * ( fn_1(x,y,0) * exp( -k * sqrt(x^2 +
(1-y)^2) ) ) }
thanks
jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Your example looked interesting so I tried it. I'm learning to hate
functions :-)
Attached is another version of the code that sorta works for me.
Thanks for posting.
"James Taylor" <jim### [at] blueyondercouk> wrote in message
news:3ce1a000@news.povray.org...
>
> "Slime" <slm### [at] slimelandcom> wrote in message
> news:3ce03d2f$1@news.povray.org...
> > Change
> >
> > #declare fn_water = function { h1*( fn_1(x,y,0)*exp(-k*x) ) }
> >
> > to
> >
> > #declare fn_water = function { h1*(
fn_1(x,y,0)*exp(-k*sqrt(x^2+y^2)) ) }
> >
> > And the exponential falloff will be dependant on the overall distance
from
> > the origin, rather than just the distance along the x axis.
> >
> > - Slime
> > [ http://www.slimeland.com/ ]
> >
> >
>
> figured it...for reasons beyond my comprehension, all y values actually
need
> to be (1-y), hence the function is:
> #declare fn_water = function {h1 * ( fn_1(x,y,0) * exp( -k * sqrt(x^2 +
> (1-y)^2) ) ) }
>
> thanks
> jim
>
>
Post a reply to this message
Attachments:
Download 'ripple2.pov.txt' (1 KB)
Download 'ripple2.jpg' (13 KB)
Preview of image 'ripple2.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Spock" <spo### [at] nospamcom> wrote in message news:3ce2573b@news.povray.org...
> Your example looked interesting so I tried it. I'm learning to hate
> functions :-)
>
> Attached is another version of the code that sorta works for me.
>
> Thanks for posting.
>
Thanks...you could also try summing together several functions which have
been translated to different positions on the hf to achieve some interesting
interference patterns.
jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |