# Shape_Blending

Document Sample

```					Shape Blending

Joshua Filliater
December 15, 2000
What is Shape Blending?

• Shape Blending is the morphing of one shape into another
shape by concentrating on the shape itself.
• Try to stretch, compress and bend one shape into another
shape over a given time period.
• Shape blending tries to morph shapes in a realistic
fashion.
• This has great practical use in the field of computer
animation.
The Major Problems

• Two Major Problems: Vertex Correspondence and Vertex Path.
• Vertex Correspondence: Figure out which vertex in the first
image should blend to which vertex in the last image. A solution is
given by Sederberg in “A Physically Based Approach to 2-D Shape
Blending”, however many people feel that the vertex
correspondence is best left to the animator.
• Vertex Path: Figure out which path the vertices should take to get
from the first image to the last image. Many solutions have been
suggested for this problem, including the Linear Interpolation
Solution, the Intrinsic Solution, the Star-Skeleton Blending
Solution, and the Wavelet Shape Blending Solution.
“A Physically Based Approach to 2-D
Shape Blending” - The Theory
• Solution to the Vertex Correspondence Solution
• Model the first polygon as a piece of wire and define the “best” shape
blend as the one that requires the least amount of work to deform the
first polygon into the last polygon through bending and stretching.
• Stretching Work: From solid mechanics, a force, P, will stretch a
wire of length L0 an amount
PL0
d
AE
where A is the cross sectional area and E is the modulus of elasticity.
Thus, the work to stretch this wire a distance, d, is
d 2 AE
W
2L0
“A Physically Based Approach to 2-D
Shape Blending” - The Theory

• Replace AE with ks, a user defined “stretching stiffness” constant.
• If L0 is the initial length of the wire, and L1 is the final length of the
wire, the previous work equation will produce different results if the
initial and final shapes are swapped.
• If an edge collapses to a single vertex, the previous work equation
requires an infinite amount of work.
• These factors are all motivation for the following change

Ws  k s
L1  L0 2
1  cs  min L0 , L1   cs max( L0 , L1 )
where cs is a user defined constant which penalizes edges that
collapse to points.
“A Physically Based Approach to 2-D
Shape Blending” - The Theory

• The square of the distance stretched implies an elastic deformation.
If excessive stretching occurs, the wire will undergo plastic
deformation. To reflect this condition, the equation is changed to

Ws  k s
L1  L0 es
1  cs  min L0 , L1   cs max( L0 , L1 )
where es is a user defined constant. An es of one denotes totally
plastic deformation, while an es of two denotes totally elastic
deformation.
• In physical reality, this equation would be valid for stretching work
only, but for the purpose of this algorithm, it is valid for both
stretching and compressing work.
“A Physically Based Approach to 2-D
Shape Blending” - The Theory

•   Bending Work: There are two conditions that should be avoided
in the bending of the shape. The first is that
i t   0 for 0  t  1
and the second is that Θi(t) should change monotonically from
Θi(0) to Θi(1). The bending work formula is
            
* eb
Wb  kb   mb   pb
where ΔΘ* is the deviation from monotonicity. kb and eb are
analagous to ks and es. mb punishes non-monotonic angles, while
pb punishes angles that go to zero.
•   The derivation of the bending work solution is analogous to that of
the stretching work solution.
“A Physically Based Approach to 2-D
Shape Blending” - The Theory

• Use the work equations to find the amount of work it takes
to blend every vertex in P0 to every vertex in P1.
• Also compute a north and a west matrix according to the
amount of work required to blend a vertex in P0 to a vertex
in P1.
• Starting from the last vertex correspondence, which is
known to be a correct correspondence, work up to the first
vertex correspondence by following the north and west
matrices.
“A Physically Based Approach to 2-D
Shape Blending” - The Theory

• Solution to the Vertex Path Problem
• This is the simplest of all Vertex Path solutions. Just
linearly interpolate the corresponding vertices.
• Mathematically, given two polygons P0 and P1 each with n
vertices, the polygons can be expressed as

P 0  P00 , P 0 ,..., Pn0
1                       1  
P1  P01 , P1 ,..., Pn1         
• From these definitions, the Vertex Path is just the linear
interpolation of the corresponding vertices over the time, t.

Pt   1  t P00  tP01 , 1  t P 0  tP1 ,..., 1  t Pn0  tPn1
1      1                            
“A Physically Based Approach to 2-D
Shape Blending” - The Results

Linear Interpolation with   Linear Interpolation with
Least Work Solution         Least Work Solution

Linear Interpolation
“A Physically Based Approach to 2-D
Shape Blending” - The Results
“A Physically Based Approach to 2-D
Shape Blending” - The Results
“A Physically Based Approach to 2-D
Shape Blending” - The Conclusions

• Positive Aspects of this Algorithm
Shapes do not generally turn themselves inside-out.

• Negative Aspects of this Algorithm
Requires a fairly reasonable initial distribution of vertices.
Can only add vertices which are already in the list of vertices.
The shapes do not generally keep the same area throughout the
blend.
“2-D Shape Blending: An Intrinsic Solution to
the Vertex Path Problem” - The Theory

• Solution to the Vertex Path Problem
• Instead of interpolating the vertices, try to be more realistic and
interpolate the angles and the edge lengths of the polygons.
• Mathematically, the edge lengths are given as
L0  Pi 1  Pi 0
i
0
L1  Pi1 1  Pi1
i       
• The angles are computed using the trigonometric identities for the
cross product and the dot product.
• From this information, the angles and lengths are interpolated by
i t   1  t i0  ti1     Li t   1  t L0  tL1
i     i

• Finally, the intermediate shapes can be reconstructed from the
angle and edge length information.
“2-D Shape Blending: An Intrinsic Solution to
the Vertex Path Problem” - The Theory

• This solution “is a heuristic whose justification lies in the fact that
it generally seems to work rather well.”
• There is one small problem. Usually, the shapes do not close.
This can be fixed by adding a small error factor to the edge length.
• In general, the error factor, Si, should be proportional to Li. Also,
it should have the same length throughout the entire shape blend.
• This error factor can be calculated through a series of equations.
Once this is calculated, the angles and edges can be interpolated
by
i t   1  t i0  ti1   Li t   1  t L0  tL1  Si
i     i
“2-D Shape Blending: An Intrinsic Solution
to the Vertex Path Problem” - The Results

Vertex Path Blend with   Vertex Path Blend with
Least Work Solution      Least Work Solution

Vertex Path Blend
“2-D Shape Blending: An Intrinsic Solution to
the Vertex Path Problem” - The Theory

• Positive Aspects of this Algorithm
The area of the shape is more or less constant throughout the
blend.
Shapes do not deform during blending.

• Negative Aspects of this Algorithm
Cannot handle coincident vertices.
“Wavelet Shape Blending”
The Theory
• Solution to the Vertex Path Problem
• Since the Intrinsic Solution does not work with dense
vertices, remove some of the vertices and then use the
Intrinsic Blend.
• To remove vertices, use the Haar Wavelet Transform.
• The Haar Wavelet Transform of polygon, P, with 2j
vertices at resolution level, k, results in a polygon of lower
resolution, P*, with 2k vertices, and a details polygon, D,
with 2j-k vertices.
Haar Wavelet Transform
• One Dimensional Example
Given a polygon with four vertices, [9,8], [7,5], [3,1], [5,4], the
Haar Wavelet Transform is computed for different resolutions as
follows.

Resolution     X Vertices     X Details      Y Vertices     Y Details
4           [9,7,3,5]                     [8,5,1,4]
2             [8,4]         [1,-1]        [6.5,2.5]     [1.5,-1.5]
1              [6]           [2]            [4.5]          [2]

The resulting polygon at resolution level 2 is ([8,6.5],[4,2.5]) with
details ([1,1.5],[4,-1.5]). The resulting polygon at resolution level
1 is ([6,2]) with details ([2,2],[1,1.5],[4,-1.5]).
“Wavelet Shape Blending”
The Algorithm
• Decompose the first and last polygons, P0 and P1, at an
appropriate resolution level into polygons, P0* and P1*, and
details, D0 and D1.
• Use the Intrinsic Blend solution to blend P0* to P1*.
• Use the Linear Interpolation Solution to blend D0 to D1.
• Reconstruct each image at time,t, using the reconstruct
algorithm of the Haar Wavelet Transform.
“Wavelet Shape Blending”
The Results

Wavelet Shape Blend   Wavelet Shape Blend
Resolution 3          Resolution 4
“Wavelet Shape Blending”
The Results

Wavelet Shape Blend   Wavelet Shape Blend
Resolution 5          Resolution 6
“Wavelet Shape Blending”
The Results

Wavelet Shape Blend   Wavelet Shape Blend
Resolution 7          Resolution 8
“Wavelet Shape Blending”
The Conclusions
• Positive Aspects of this Algorithm
Can handle a reasonable amount of coincident vertices.
Shapes do not deform during blending at higher
resolutions.

• Negative Aspects of this Algorithm
Cannot handle too many coincident vertices.
Shapes tend to have “broken” lines.
“Shape Blending Using the
Star-Skeleton Representation”
• Solution to the Vertex Path Problem
• Decompose the first and last polygons, P0 and P1, into star-shaped
pieces, each represented by its vertices and the star origin. A star-
shape is a polygon for which there exists at least one point that is
visible from all other points. This point is called the star origin.
• Form the skeleton by connecting the star origins and the midpoints
of shared edges in an altering fashion.
• Linearly interpolate the between the skeletons of polygon P0 and P1.
• Compute the coordinates of each vertex on the boundary of the
polygon from the original vertex, the star origin, and the midpoints
of the shared edges.
Shape Blending:
The Conclusions
• What conclusions can be drawn from all of this?

A good initial distribution of vertices is extremely
important.
The vertex correspondence problem is still best solved by
the animator.
The computer can be used to solve the vertex path problem
References
• T.W. Sederberg and E. Greenwood, “A Physically Based
Approach to 2D Shape Blending,” Computer Graphics
(Proc. SIGGRAPH), Vol. 26, No.2, 1992, pp. 25-34.
• T.W. Sederberg et al., “2D Shape Blending: An Intrinsic
Solution to the Vertex Path Problem,” Computer Graphics
(Proc. SIGGRAPH), Vol. 27, 1993, pp. 15-18.
• M. Shapira and A. Rappoport, “Shape Blending Using the
Star-Skeleton Representation,” IEEE Computer Graphics
and Applications, March, 1995, pp. 44-50.
• Y. Zhang and Y. Huang, “Wavelet Shape Blending,” The
Visual Computer, Vol. 16, No. 2, 2000, pp.106-115.
• E.J. Stollnitz, T.D. DeRose, and D.H. Salesin, “Wavelets for
Computer Graphics: A Primer, Part 1” IEEE Computer
Graphics and Applications, Vol. 15, No. 3, 1995, pp.76-84.
• E.J. Stollnitz, T.D. DeRose, and D.H. Salesin, “Wavelets for
Computer Graphics: A Primer, Part 2” IEEE Computer
Graphics and Applications, Vol. 15, No. 4, 1995, pp.75-85.

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 2 posted: 10/12/2011 language: English pages: 28