Mesh Shape Editing - University of...

55
Mesh Shape Editing Computer Animation and Visualisation Lecture 16 Taku Komura

Transcript of Mesh Shape Editing - University of...

Page 1: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Mesh Shape Editing

Computer Animation and Visualisation

Lecture 16

Taku Komura

Page 2: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Today

– Laplacian mesh editing

– As-rigid-as possible shape interpolation

– Generalized Barycentric Coordinates

Page 3: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Editing shapes

• For animating rigid/articulated objects, we can use previous techniques like rigging

• Let’s think of animating cloths, clay, rubber, soft tissues, dolls, etc

Page 4: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Editing shapes• Usually, it is easier to edit a given shape rather

than modeling it from the beginning

• What is important when editing shapes?

• Keeping the local information unchanged–For faces, the relative location of the eyes,

nose, and mouth must be similar to the original mesh

• As-rigid-as possible

• Laplacian coordinates

Page 5: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Surface Editing

• Must – Be fast (interactive rate)– Preserving the details

– > Differential coordinates – Laplacian coordinates– Linear, invariant to scale, rotation [Sorkine ’04]

Page 6: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Laplacian coordinates

• Assuming all polygons are split into triangles

• Every vertex vi is surrounded by a group of vertices Ni

• Laplacian Coordinates of i is the difference between vi and the average of its neighbors

• The transformation between the Laplacian coordinates and the original vertices is linear

Page 7: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Laplacian coordinates (2)

• Suppose the new position of the vertices are v'i

• We want to keep the Laplacian coordinates the same after the deformation

• T is a homogeneous transformation of scaling, rotation, and translation

Page 8: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Laplacian coordinates (3)

• We also want to constrain the position of some points (keeping vi’ close to ui)

• After all, we need to minimize the following function

• This becomes a simple quadratic optimization problem

Page 9: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Editing Surfaces by Keeping the Details

• The user specifies the region of interest (ROI) (the area to be edited)

• The user directly moves some of the vertices • The rest of ROI is decided by minimizing the

error function

Page 10: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Some more …http://www.youtube.com/watch?v=Yn3P4EK8sYE&feature=channel_page

Page 11: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

It is possible to add more constraints

• Sometimes the shape might shrink as we allow scaling for the transformation

• It might be better to keep the volume the same

Page 12: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Creating a Volumetric Graph

• Add internal vertices and edges • Compute and preserve the details for the internal structure

Page 13: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Some Results

Page 14: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Today

– Laplacian mesh editing

– As-rigid-as possible shape interpolation

– Generalized Barycentric Coordinates

Page 15: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

What if we want to interpolate different shapes?

– Not just editing the shapes but need to morph it to the target shape

Page 16: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

As-Rigid-As Possible Shape Interpolation [Alexa ’00]

• Interpolating the shapes of the two polygons so that each triangle (2D) / tetrahedron (3D) transformation appears as rigid as possible

Page 17: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Interpolating the shapes of triangles Represent the interpolation of triangles by

rotation & scaling

• linear interpolation

• rotation & scaling

Page 18: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

18

Background Knowledge:2x2 matrix

Scaling

Rotation

A

A

Page 19: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

19

Transformation by 2x2 Matrix

If the matrix is symmetric, can be decomposed as

A = R Λ RT, R orthogonal, where Λ scaling matrix

(true if A is symmetric)

The eigenvectors of A are the axes of the ellipse

A

Page 20: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

20

Geometric analysis of linear transformations

If the matrix is symmetric, can be decomposed as

A = R Λ RT, R orthogonal (true if A is symmetric)

The eigenvectors of A are the axes of the ellipse

RRT

Λ

Page 21: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

21

General linear transformations: Singular Value Decomposition (SVD)

In general A will also contain rotations, not just scales:

A

1 1 σ2

σ1

TA U V= ∑

Page 22: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

22

General Transformation : SVD

UVT

Σ

TA U V= ∑

σ2

σ1

Page 23: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Back to ARAP DeformationLeast-Distorting Triangle-to-Triangle Morphing

• Say the three vertices P=(p1,p2,p3) are morphed to Q=(q1,q2,q3)

We want to compute a transformation that produces (q2-q1, q3-q1)=A (p2-p1, p3-p1)

• We can apply SVD to compute the scaling and rotation part.

• A = R S

rotationscaling

SR

Page 24: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Interpolation of the transformation matrix

The intermediate vertices will be computed by

V(t)=A(t) P

A is decomposed into the rotation part R(t) and scaling part and S.

Page 25: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Keeping the transformation similar to A{i, j, k}

A vertex configuration that minimizes the error between A and B

Page 26: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Some 2D results

Page 27: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

3D objects

• The method is applicable to polyhedra

• Tetrahedralization is applied to polyhedra and the tetrahedra are morphed so that they are as rigid as possible

Page 28: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

More results

Page 29: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

As-rigid-as possible shape manipulation [Igarashi et al. 05]

• Interactive manipulation of characters based on the “as-rigid-as-possible” concept

• http://www-ui.is.s.u-tokyo.ac.jp/~takeo/research/rigid/index.html

• http://www.youtube.com/watch?v=1M_oyUEOHK8

Page 30: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Today

– Laplacian mesh editing

– As-rigid-as possible shape interpolation

– Generalized Barycentric Coordinates

Page 31: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Barycentric Coordinates

- For every point v with in the polygon, weights wi are defined, which represents the influence from point i (pi)

- wi = 1 & wj = 0 when p = pi and i != j

- 0 < wi < 1, Σ wi = 1

v

p1

p2 p3

p4p5

Page 32: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Barycentric Coordinates - InterpolationGeometric interpolation – derive the global

coordinates for a position in parametric cell space

Attribute interpolation – derive the attribute value for a position defined in parametric cell space

are called barycentric coordinatesDemo

v

p1

p2 p3

p4p5

v

f1

f2 f3

f4p5

f(v)

http://www.lidberg.se/math/shapetransforms/barycentric.html

Page 33: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

ApplicationsSurface Deformation

Control Mesh Surface Computing Weights Deformation

216 triangles 30,000 triangles 1.9 seconds 0.03 seconds

Page 34: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

ApplicationsSurface Deformation

Control Mesh Surface Computing Weights Deformation

98 triangles 96,966 triangles 3.3 seconds 0.09 seconds

Page 35: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

ApplicationsBoundary Value Problems

Page 36: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

ApplicationsSolid Textures

Interpolating the texture coordinates

Extend texture to interior

Page 37: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

How to compute the barycentric coordinates for each point?

x

p0

p1

p2

p3

p4

p5

r

s

Page 38: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Wachspress coordinates

http://www.lidberg.se/math/shapetransforms/wachspress.html

Page 39: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Mean Value Coordinates

A good and smooth barycentric coordinates that can smoothly interpolate the boundary values

Also works well for concave polygons

There is also a 3D version

Page 40: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Comparison

[Wachspress 1975]Mean Value Coordinates

[Floater 2003, Hormann 2004]

Page 41: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Previous Work

[Wachspress 1975]Mean Value Coordinates

[Floater 2003, Hormann 2004]

Page 42: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Previous Work

[Wachspress 1975]Mean Value Coordinates

[Floater 2003, Hormann 2004]

Page 43: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Previous Work

[Wachspress 1975]Mean Value Coordinates

[Floater 2003, Hormann 2004]

Page 44: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Application:Surface Deformation

piv

Page 45: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Application:Surface Deformation

piv

Page 46: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Application:Surface Deformation

v̂=∑ w i p̂ i

∑ wi

p̂ipiv

Page 47: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Application:Surface Deformation

v pi

v̂=∑ w i p̂ i

∑ wiv̂

p̂i

Page 48: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Interpolation : problem polygon

http://www.youtube.com/watch?v=egf4m6zVHUI

Page 49: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Affected by the vertices close in terms of Euclidean distance

Page 50: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Harmonic Coordinates

Harmonic Scalar Field

– The value depends on the distance travelled inside the polygon

Not affected by the Euclidean distance but the geodesic distance

Page 51: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Harmonic Coordinates :Procedure

- For each vertex i of the cage, set the potential

value of vi to 1, and the rest to 0

- Compute the potential by solving a Laplace equation (as taught in Lecture 15)

- Say the potential is pi for point v0

- After normalization, (p1, p2, ... , pn) is the harmonic coordinates for v0

- The global position of the point can be expressed in the form

P = p1 v1 + p2 v2 + … + pn vn

Page 52: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Harmonic Coordinates:comparison

Page 53: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Barycentric CoordinatesSummary

Triangulation / TetrahedralizationOnly C0 continuous at the boundaries

Wachspress coordinatesCan only handle convex objects

Mean value coordinatesCan handle concave objects well to some extent

Values affected by geometrically close control points

Defined outside the polygon too

Harmonic CoordinatesCan handle concave objects well

Only defined inside the polygon

Page 54: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Summary

Modelling surfaces • Deforming surfaces

– Laplacian Coordinates– As-rigid-as possible shape interpolation

• Generalized Barycentric Coordinates

Page 55: Mesh Shape Editing - University of Edinburghhomepages.inf.ed.ac.uk/tkomura/cav/presentation16_2015.pdf · Editing shapes • For animating rigid/articulated objects, we can use previous

Readings• Alexa et al. “As-rigid-as-possible shape interpolation SIGGRAPH

’00• Igarashi et al. “As-rigid-as-possible shape manipulation”,

SIGGRAPH ‘05• O. Sorkine, D. Cohen-Or, Y. Lipman, M. Alexa, C.

Rössl and H.-P. Seidel, “Laplacian Surface Editing”, Eurographics Symposium on Geometry Processing (2004)

• Large Mesh Deformation Using the Volumetric Graph Laplacian Kun Zhou, Jin Huang, John Snyder, Xinguo Liu, Hujun Bao, Baining Guo,

Heung-Yeung Shum. ACM SIGGRAPH 2005, 496-503.• Harmoinc Coordinates for Character Articulation: Joshi et al.

SIGGRAPH 2007• Mean Value Coordinates for Closed Triangular Meshes, Ju et al.

SIGGRAPH 2005