POV-Ray : Newsgroups : povray.binaries.images : ocean wave simulation : ocean wave simulation Server Time
4 Nov 2024 20:14:05 EST (-0500)
  ocean wave simulation  
From: Lukas Winter
Date: 2 May 2007 11:52:27
Message: <pan.2007.05.02.15.52.25.967812@removeit.geloescht.net>
At the moment I am integrating "aqua library"
(http://savannah.nongnu.org/projects/aqua/), a library that simulates
ocean surfaces, into povray as a patch. The patch reads in vertex and
normal data from the library and converts them to an (almost) rectangular
smooth mesh. What I think is the best about it, is, that the surface is
theoretically fully animatable, tileable and even loopable. Unfortunately
at the current state of the patch the surface cannot be animated, because
libaqua seeds its random generator internally with the current time. The
corresponding SDL-code looks like this:
water_mesh
{
  precompute 512, 512, 4 
  /*number of points in x and z direction, displacement in normal
  direction ("sharpness" of the waves)*/
  size <100, 100>  //size in metres and pov-units respectively
  waves .1, 200  //smallest and largest wavelength (term from the library)
  phase clock  //animation parameter, in seconds?
  water_level 10  //depth (term from the library) of the water
  repeat 1  //number of seconds? before the animation repeats
  method 1
  /*1, 2 and 3 stand for different generation methods, but only 1 is
  implemented at the moment (fft::Surface_Pierson_Ug)*/
  form 1.0  //spectrum factor (term from the library)
}

I have no clue what water_level/depth and form/spectrum factor actually
do, but not all methods use the same parameters. A way to change the wind
speed and its direction is currently not supported. An image says more
than thousand words, as a german saying goes:
http://geloescht.net/allerlei/test_waves.jpg
You can see where two tiles overlap a bit on the left. There is no foam,
the bright spots on the right are highlights. I don't know if I can or
will release the source code, as aqaulib's license is GPL and there are
still some unimplemented parts in it.
Lukas


Post a reply to this message

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