Game Development Reference

In-Depth Information

Figure 10.7.
The two figures on the right show an example of surface mesh, and the two

figures on the left show the associated volumetric mesh (see Color Plate XII).

•

a highly detailed surface representation of the object, usually provided by

the game artist and used for the graphical rendering.

The surface mesh is driven by the tetrahedral mesh, i.e., the vertices of the

surface mesh are displaced following the underlying tetrahedral mesh, creating

a deformation visual effect. This process can be done very efficiently using the

barycentric coordinates described in Equations (10.6), (10.7), (10.8), and (10.9).

The surface-mesh update algorithm needs to link each surface-mesh vertex

with a volumetric-mesh element in a preprocessing stage. All the vertices inside

a tetrahedron are linked to that tetrahedron. An easy way to test whether a vertex

p
is inside tetrahedron
e
is to compute its barycentric coordinates using Equa-

tions (10.7) and (10.8). Once
ξ
=[
ξ
1
,ξ
2
,ξ
3
,ξ
4
] is calculated,
p
is inside
e
if and

only if the following two constraints are satisfied:

1.
x
i
≥

0

∀

i

∈{

1
,
2
,
3
,
4

}

,

2.
x
i
≤

1

∀

i

∈{

1
,
2
,
3
,
4

}

.

If a vertex is not inside any tetrahedron, it will be linked to the closest one.

We store the barycentric coordinates
ξ
of each vertex with respect to its linked

tetrahedron. When the surface mesh is rendered, we can update the vertex po-

sition using
ξ
and its linked tetrahedron node displacements, as shown in Equa-

tion (10.2). Note that the simulation usually runs at higher frequencies than does