The waves include file
This include file simulates water waves in a very simple model. The mathematical background is described in a paper on visualizing water surfaces (German) by Bertram Walter. A different implementation with some description can be found in an article of PC Magazin, issue 12/2001.
The model leads to fairly realistic results under certain circumstances:
- the water surface is infinitely large, without rims
- the water is very deep
- there is no splashing
The main idea is superposing a lot of sine waves with different frequencies, amplitudes and directions according to certain distribution functions.
The include file contains a macro
that generates
a user defined function.
This can be used in a height_field
,
normal
statement and isosurface
,
but the latter can be extremely slow since the function is quite long. By making the third
parameter dependant on clock
it can be used in animations.
Syntax is the following:
function { Waves(Wind_Direction, Wind_Speed, Time, Scale) }
The parameters:
Wind_Direction:
main wind direction (radians)Wind_Speed:
wind speed (mainly influencing the frequency distribution)Time:
time control for animationScale:
total scaling factor
Files for download:
Sample animations:
MPEG file 512x384, 357 kB | MPEG file 512x384, 594 kB |