i
i
i
i
i
i
i
i
530 18. Building on the Basics, Some Projects in VR
turn the mesh to its original shape when we release the vertex at
point p
. In a simple one-dimensional spring (Figure 18.14(c)),
the restoring force is proportional to the extension in the length
of the spring. In Figure 18.14(d), when two or more springs
are connected, all the nonfixed points such as p
1
may move. All
new positions must be obtained simultaneously; in this 1D case
an analytic solution of the math model may be obtained. In Fig-
ure 18.14(e), if the springs forms a complex 3D network then
the effect of a distortion must be obtained using a numerical so-
lution technique. In Figure 18.14(f), when the point p is moved
to p
, the forces in all attached springs will change and the shape
of the network will adjust to a new state of equilibrium.
This model fits very well with our polygonal representation of shapes.
The edges in our mesh model correspond to the little springs connected into
a 3D network by joining the vertices together. We think of the original con-
figuration of the model as being its rest state, and as we pull one or more of
the vertices, the whole network of springs adjusts to take on a new shape, just
as they would if we really built the model out of real springs and pulled or
pushed on one of them.
The behavior of this network of springsismodeledmathematically by
using the well-known laws of Hooke and Newton. Hooke tells us that the
restoring force F in a spring is proportional to the extension in the spring
p. That is, F = k p,wherek is the constant of proportionality. Newton
tells us that the acceleration a of a particle (in our case a vertex in our mesh)
with a mass m is proportional to the force applied to it. That is, F = ma.We
also know that acceleration is the second differential of the distance moved, so
this equation can be rewritten as F = m
..
p
. This differential equation would
be relatively easy to solve for a single vertex and one spring, but in a mesh
with hundreds of vertices interconnected by springs in three dimensions, we
have to use a computer to solve it and also use a numerical approximation to
the modeling equations.
Several numerical techniques can be used to solve the equations that sim-
ulate how the vertices respond to an applied disturbance (House and Breen [4]
discuss this in depth). One technique that is fast and simple and has been used
by physicists for solving dynamic particle problems has also been shown by
computer game developers to be particularly good for our type of problem. It
is called Verlet integration [9], and whilst it allows us to avoid the complexity
of carrying out an implicit solution for the equations, we can also still avoid