shape blending joshua filliater december 15, 2000

28
Shape Blending Joshua Filliater December 15, 2000

Upload: phillip-doyle

Post on 26-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Shape Blending Joshua Filliater December 15, 2000

Shape Blending

Joshua Filliater

December 15, 2000

Page 2: 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.

Page 3: Shape Blending Joshua Filliater December 15, 2000

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.

Page 4: Shape Blending Joshua Filliater December 15, 2000

“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

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

AE

PLd 0

0

2

2L

AEdW

Page 5: Shape Blending Joshua Filliater December 15, 2000

“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

where cs is a user defined constant which penalizes edges that collapse to points.

),max(,min1 1010

201

LLcLLc

LLkW

ssss

Page 6: Shape Blending Joshua Filliater December 15, 2000

“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

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.

),max(,min1 1010

01

LLcLLc

LLkW

ss

e

ss

s

Page 7: Shape Blending Joshua Filliater December 15, 2000

“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

and the second is that Θi(t) should change monotonically from Θi(0) to Θi(1). The bending work formula is

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.

10for 0 tti

b

e

bbb pmkW b *

Page 8: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 9: Shape Blending Joshua Filliater December 15, 2000

“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

• From these definitions, the Vertex Path is just the linear interpolation of the corresponding vertices over the time, t.

111

10

1 ,...,, nPPPP 001

00

0 ,...,, nPPPP

1011

01

10

00 1,...,1,1 nn tPPttPPttPPttP

Page 10: Shape Blending Joshua Filliater December 15, 2000

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

Linear Interpolation with Least Work Solution

Linear Interpolation with Least Work Solution

Linear Interpolation

Page 11: Shape Blending Joshua Filliater December 15, 2000

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

Page 12: Shape Blending Joshua Filliater December 15, 2000

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

Page 13: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 14: Shape Blending Joshua Filliater December 15, 2000

“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

• 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

• Finally, the intermediate shapes can be reconstructed from the angle and edge length information.

001

0iii PPL

111

1iii PPL

101 iii ttt 101 iii tLLttL

Page 15: Shape Blending Joshua Filliater December 15, 2000

• 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

101 iii ttt iiii StLLttL 101

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

Page 16: Shape Blending Joshua Filliater December 15, 2000

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

Vertex Path Blend with Least Work Solution

Vertex Path Blend with Least Work Solution

Vertex Path Blend

Page 17: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 18: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 19: Shape Blending Joshua Filliater December 15, 2000

Haar Wavelet Transform

• One Dimensional ExampleGiven 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]).

Page 20: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 21: Shape Blending Joshua Filliater December 15, 2000

“Wavelet Shape Blending” The Results

Wavelet Shape Blend

Resolution 3

Wavelet Shape Blend

Resolution 4

Page 22: Shape Blending Joshua Filliater December 15, 2000

“Wavelet Shape Blending” The Results

Wavelet Shape Blend

Resolution 5

Wavelet Shape Blend

Resolution 6

Page 23: Shape Blending Joshua Filliater December 15, 2000

“Wavelet Shape Blending” The Results

Wavelet Shape Blend

Resolution 7

Wavelet Shape Blend

Resolution 8

Page 24: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 25: Shape Blending Joshua Filliater December 15, 2000

“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.

Page 26: Shape Blending Joshua Filliater December 15, 2000

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

Page 27: Shape Blending Joshua Filliater December 15, 2000

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.

Page 28: Shape Blending Joshua Filliater December 15, 2000

Additional References

• 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.