Game Development Reference
For an accurate (based on the physical definition of the strain tensor) simula-
tion, Chapter 10 provides much better results.
Although the calculations could be applied to the mesh during a preprocessing
stage to reduce computational effort, the technique is very well-suited for real-
time processing for the benefit of interactivity of the animation. The skeleton-
Special collision-detection algorithms might be needed here [Teschner et al. 05],
which is unfortunately a lot more computationally intensive. This is beyond the
scope of this chapter.
Appendix: Calculating the Optimal Rotation
For the shape-matching algorithm, a rotation is needed that best matches a given
set of points to another set of points (with an equal number of points) by mini-
mizing their distance-squares.
Since we already matched the centers of mass (so there is no translation nec-
essary for optimization anymore), we define the relative locations by
q i = x i −
p i = x i −
We start off by searching for a linear transformation A such that c i = Aq i +
x cm matches x i best, and then we try to extract the rotation that A contains. The
quantity we have to minimize can now be written as
m i ( Aq i − p i ) 2 .
We should now focus on the contribution of one neighbor i and omit the mass
for now. We can simplify our notation for the next few calculations to
p ) 2 =( Aq
p )( q T A T
p T ) .
Now we write out the multiplications component-wise (take care: u, v, w are
matrix and vector entry indices now, not particle indices):
A uv q v −
A uw q w −
A uv q v
− 2 p u
A uv q v +
p u .