POV-Ray : Newsgroups : povray.unofficial.patches : Making waves - isosurface help Server Time
1 Sep 2024 22:16:26 EDT (-0400)
  Making waves - isosurface help (Message 1 to 3 of 3)  
From: Tom Melly
Subject: Making waves - isosurface help
Date: 20 Jul 2000 04:53:54
Message: <3976be22@news.povray.org>
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

From: Michael Andrews
Subject: Re: Making waves - isosurface help
Date: 20 Jul 2000 05:56:03
Message: <3976CC76.4D63796D@reading.ac.uk>
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

From: Chris Huff
Subject: Re: Making waves - isosurface help
Date: 20 Jul 2000 09:48:32
Message: <chrishuff-FE1F5E.08490620072000@news.povray.org>
In article <3976be22@news.povray.org>, "Tom Melly" 
<tom### [at] tomandluf9couk> 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] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

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