|
![](/i/fill.gif) |
Hi Tom,
The simplest is probably
#declare My_Ripples = function { sin(2*pi*sqrt(sqr(x)+sqr(z))) }
#declare Water_Surface = function { y - 0.2*My_Ripples }
and use function { Water_Surface } in the isosurface.
If you want more sea wave shaped ripples, I find
#declare Water_Surface = function { y - 0.2*abs(My_Ripples(x/2,0,z/2))^N
}
where N is around 6 or so is quite good.
Bye for now,
Mike Andrews.
Tom Melly wrote:
>
> Assuming I didn't want to just use an inbuilt function, etc., what would be
> the equation to generate a pattern similiar to ripples in an isosurface?
> (ie. circular waves propagating outwards from a point).
>
> Ta.
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3976be22@news.povray.org>, "Tom Melly"
<tom### [at] tomandlu f9 co uk> wrote:
> Assuming I didn't want to just use an inbuilt function, etc., what
> would be the equation to generate a pattern similiar to ripples in an
> isosurface? (ie. circular waves propagating outwards from a point).
You usually use the cosine of the distance from that point. This gives
an "onion" type pattern, with the waves emanating in all directions from
a point. You can also constrain it to a certain plane by removing one
axis from the calculations, which makes it act like wood. You may want
this for some uses.
Where <A, B, C> are the coordinates of the "center" of the ring:
"onion-like" function:
function {cos(2*pi*sqrt(sqr(x-A) + sqr(y-B) + sqr(z-C)))}
"wood-like" function(along y-axis):
function {cos(2*pi*sqrt(sqr(x-A) + sqr(z-C)))}
It is also possible to have the "waves" fall off with distance. To do
this, just multiply the above function by a function which falls off
with distance, like this:
Where R = radius, F = falloff exponent.
#declare D = function {cos(2*pi*sqrt(sqr(x) + sqr(y) + sqr(z)))}
function {
D(x-A,0,z-C)*((max(0, R-sqrt(sqr(x-A) + sqr(z-C)))/R)^F)
}
Some additional things: I use sqr(x) instead of x*x or x^2, because it
may be slightly faster. I also prefer to use cosine instead of sine for
waves, because it makes a smooth center.
Disclaimer: I haven't actually tested these functions, there may be an
error or typo somewhere. They should be close, though...
--
Christopher James Huff - Personal e-mail: chr### [at] mac com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |