Game Development Reference

In-Depth Information

Chapter 15 Summary

The Wave Equation

The two-dimensional wave equation for a surface experiencing a viscous damp-

ing force is

2

2

2

∂

z

∂

z

∂

z

∂

z

2

=

c

+

−

μ

.

∂

t

2

∂

x

2

∂

y

2

∂

t

The constant
c
is the speed at which waves propagate through the medium, and

the constant

represents the viscosity of the medium.

μ

Approximating Derivatives for a Fluid Surface

The first derivative of a function

()

zx
can be approximated by the formula

(

)

(

)

d
zx

dx

zx d zx d

+− −

()

≈

,

2

d

where
d
represents some constant step size. The second derivative of

zx
can be

()

approximated by the formula

(

)

( )

(

)

d

2

zx d zx zx d

+−

2

+ −

zx

()

≈

.

dx

2

d

2

Evaluating Fluid Surface Displacement

The future displacement

(

)

of a point on the surface of a fluid after a

time
t
has passed is calculated using the equation

zijk

,,

+

1

48

−

ct d

22

2

μt

−

2

(

)

(

)

(

)

zijk

,,

+=

1

zijk

,,

+

zijk

,,

−

1

μt μt

ct d
zi jk zi jk zij k zij k

μt

+

2

+

2

22

2

2

[

]

(

)

(

)

(

)

(

)

+

+

1,

,

+

−

1,

,

+

,

+

1,

+

,

−

1,

,

+

2

where
d
is the distance between neighboring vertices in the triangle mesh.

Stability of the Numerical Method for a Fluid

Given a constant time step
t
, the wave speed
c
must satisfy

d

0

<<

c

μt

+

2

.

2

t

Search Nedrilad ::

Custom Search