POV-Ray : Newsgroups : povray.general : Creating a ripple effect : Re: Creating a ripple effect Server Time
4 Aug 2024 20:18:46 EDT (-0400)
  Re: Creating a ripple effect  
From: Mark Weyer
Date: 21 Feb 2003 04:57:56
Message: <3E55FB1A.4000802@informatik.uni-freiburg.de>
> How can I create ripple effect like when a helicopter is flying above a
> water surface?  I could use the "ripples" pattern but I don't want the whole
> water surface to become rippled.  I want the ripples to gradually fade away
> from the center.  I also don't want the ripples to originate exactly from
> the center because that is not realistic when a helicopter is flying
> overhead.  The ripples should around the perimeter of the helicopter.

There are two approaches I know of: Normals and isosurfaces.
I am usually not satisfied with normals.
My approach would be to make the water an isosurface. The isosurface
function would be a sum of elementary ripples. One elementary ripple
has the form

   sin(sqrt(pow(x-center_x,2)+pow(y-center_y,2))*2*pi/wavelength+phase)*amplitude

or, if the ripples should be parallel (e.g. those that are there even
if the helicopter is not),

   sin((x*dx+y*dy)*2*pi/wavelength+phase)*amplitude

where (dx,dy) is the direction of the wave movement.
The whole isosurface function would be

   ripple_1(x,y)+...+ripple_n(x,y)+z

I assume here that z is up.
If this is for an animation, choose

   phase=phase_0-clock*speed*2*pi/wavelength

The speed of all elementary waves should be equal.
If you want to turn that into a normal pattern (for render speed that
would be), the normal is the gradient of the isosurface function, i.e.

   cos(sqrt(pow(x-center_x,2)+pow(y-center_y,2))*2*pi/wavelength+phase) *
   vnormalize(x-center_x,y-center_y,0)*2*pi/wavelength * amplitude

   cos((x*dx+y*dy)*2*pi/wavelength+phase) * (dx,dy,0) * amplitude

   normal_1(x,y)+...normal_n(x,y)+(0,0,1)



-- 
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}//  Mark Weyer


Post a reply to this message

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