Graphics Reference
In-Depth Information
used to interpolate values within grid cells. Peachey [ 15 ] successfully uses bilinear interpolation to
accomplish this.
ð x
0 y
0
i ðu; z; tÞdu
y i ðx; z; tÞ¼
(8.8)
The wave profile function, wi , is a single-value periodic function of the fraction of the phase func-
tion (Eq. 8.5 ) so that w i ( u ) is defined for 0.0
u
1.0. The values of the wave profile function range
over the interval [
1, 1]. The wave profile function is designed so that its value is one at both ends of
the interval (Eq. 8.9 ).
o i ð
0
;
0
Þ¼o i ð
1
:
0
Þ¼
1
:
0
(8.9)
Linear interpolation can be used to model the changing profile of the wave according to steepness.
Steepness ( H / L ) can be used to blend between a sinusoidal function (Eq. 8.1 ) and a cycloid-like
function (Eq. 8.10 ) designed to resemble a sharp-crested wave profile. In addition, wave asymmetry
is introduced as a function of the depth of the water to simulate effects observed in waves as they
approach a coastline. The asymmetry interpolant, k , is defined as the ratio between the water depth,
d , and deep-water wavelength, L i (see Eq. 8.11 ). When k is large, the wave profile is handled with
no further modification. When k is small, u is raised to a power in order to shift its value toward
the low end of the range between zero and one. This has the effect of stretching out the back of the
wave and steepening the front of the wave as it approaches the shore.
2
o i ðuÞ¼
8
ju
1
=
2
j
1
(8.10)
2
i
2 p
gT
deep
i ¼
L
(8.11)
d
k ¼
deep
i
L
As the wave enters very shallow water, the amplitudes of the various wave components are reduced
so the overall amplitude of the wave is kept from exceeding the depth of the water.
Spray and foam resulting from breaking waves and waves hitting obstacles can be simulated using
a stochastic but controlled (e.g., Gaussian distribution) particle system. When the speed of the water,
Q average , exceeds the speed of the wave, C , then water spray leaves the surface of the wave and
is thrown forward. Equation 8.2 indicates that this condition happens when pS>
1.0 or, equivalently,
S >
1.0/ p . Breaking waves are observed with steepness values less than this (around 0.1), which
indicates that the water probably does not travel at a uniform orbital speed. Instead, the speed of
the water at the top of the orbit is faster than at other points in the orbit. Thus, a user-specified
spray-threshold steepness value can be used to trigger the particle system. The number of particles
generated is based on the difference between the calculated wave steepness and the spray-threshold
steepness.
For a wave hitting an obstacle, a particle system can be used to generate spray in the direction of
reflection based on the incoming direction of the wave and the normal of the obstacle surface. A small
number of particles are generated just before the moment of impact, are increased to a maximum
 
Search WWH ::




Custom Search