Top Banner
Deformation I
44

18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Sep 02, 2018

Download

Documents

duongduong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Deformation I

Page 2: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

DeformationDeformation

Page 3: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

MotivationMotivation

Easy modeling – generate new shapes by deforming existing onesg g

Page 4: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

MotivationMotivation

Easy modeling – generate new shapes by deforming existing onesg g

Page 5: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

MotivationMotivation

Character  posing for animation

Page 6: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ChallengesChallenges

l l blUser says as little as possible…

l h d d h…algorithm deduces the rest

Page 7: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ChallengesChallenges

“Intuitive deformation”global change + local detail preservationg g p

Page 8: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ChallengesChallenges

“Intuitive deformation”global change + local detail preservationg g p

Page 9: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ChallengesChallenges

Efficient!

Page 10: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Rules of the GameRules of the Game

Deformation Shape

Deformed ShAlgorithm

Shape Shape

Constraints

Position: “Thi i t th ”

Orientation/Scale: “Th i t f thi

Other shape property: C t i t“This point goes there” “The environment of this 

point should rotate/scale”Curvature, perimeter,…

[ Parameterization is also “deformation”: constraints = curvature 0 everywhere ]

Page 11: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ApproachesApproaches

• Surface deformation– Shape is empty shellp p y

• Curve for 2D deformation

• Surface for 3D deformationSurface for 3D deformation

D f ti l d fi d on h– Deformation only defined on shape

– Deformation coupled with shape representation

Page 12: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ApproachesApproaches

• Space deformation– Shape is volumetricp

• Planar domain in 2D

• Polyhedral domain in 3DPolyhedral domain in 3D

– Deformation defined in neighborhood of shape– Deformation defined in neighborhood of shape

– Can be applied to any shape representation

Page 13: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ApproachesApproaches

• Surface deformation– Find alternative representation which is p“deformation invariant”

• Space deformation– Find a space map which has “nice properties”Find a space map which has  nice properties

Page 14: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Surface DeformationSurface Deformation

Setup:– Choose alternative representation f(S)p f( )

Given S find S’ such that

R

– Given S find S  such that• Constraints(S’) are true

f(S’) f(S)

S

RR1• f(S’) = f(S) 

(or close)

bl

R2R3

• An optimization problem

Page 15: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Shape RepresentationShape Representation

d i h i ?How good is the representation?– Representation should always be invariant to:

• Global translation• Global rotation• Global scale? Depends on application• Global scale? Depends on application

Shapes we want “reachable” should have similar– Shapes we want  reachable  should have similar representations

• Almost isometric deformation local translation + rotation

• Almost “conformal” deformationlocal translation + rotation + scalelocal translation + rotation + scale

Page 16: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Shape RepresentationShape Representation

Robustness– How hard is it to solve the optimization problem?p p

– Can we find the global minimum?

Small change in constraints similar shape?– Small change in constraints  similar shape?

EfficiencyCan it be solved at interactive rates?– Can it be solved at interactive rates?

Page 17: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Shape RepresentationsShape Representations

Rule of thumb:

If representation is a linear function of theIf representation is a linear function of the coordinates, deformation is:

bRobust

Fast

B t t ti i t t ti i i t!But representation is not rotation invariant!

(for large rotations)g

Page 18: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Surface RepresentationsSurface Representations

L l i di t• Laplacian coordinates

• Edge lengths + dihedral angles

• Pyramid coordinates

• Local frames

• ….

Page 19: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Laplacian Coordinates [Sorkine et al 04]Laplacian Coordinates [Sorkine et al. 04]

• Control mechanism– Handles (vertices) moved by user( ) y

– Region of influence (ROI)

Movie

Page 20: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Laplacian CoordinatesLaplacian Coordinates

δ = LV = (I-D-1A)VI = Identity matrix

D = Diagonal matrix [dii = deg(vi)]A = Adjacency matrix

V = Vertices in mesh

Approximation to normals ‐ unique up to translationApproximation to normals unique up to translation

Reconstruct by solving  LV = δ for V, with one constraint

Poisson equation

Page 21: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

DeformationDeformation

• Pose modeling constraints for vertices C ⊂ V– v’i = ui i ∈ Ci i

N t l ti i i i• No exact solution, minimize error

Laplacian Laplacian User Constraintscoordinates of original mesh

coordinates of deformed mesh

Page 22: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

DeformationDeformation

Laplacian Laplacian User Constraintscoordinates of original mesh

coordinates of deformed mesh

Page 23: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Linear Least SquaresLinear Least Squares

• Ax = b with m equations, n unknowns

• Normal equations: (ATA)x = ATb• Solution by pseudo inverse: 

x = A+b = [(ATA)-1AT]b

If system under determined: x = arg min { ||x|| : Ax = b }If system over determined:    x = arg min { ||Ax-b||2 }

Page 24: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Laplacian CoordinatespSanity Check

• Translation invariant? 

• Rotation/scale invariant?

δiδi

iδi

Page 25: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

ProblemProblem

Page 26: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

input Laplacian coords “Rotation invariant” coordsinput Laplacian coords Rotation invariant  coords

Page 27: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

“Rotation Invariant” CoordsRotation Invariant  Coords

The representation should take into account local rotations + scale

δi = L(vi) Tiδi = L(v’i)

vi v'

δi

δi

δi

i

Tiδi

v i

δi

Page 28: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

“Rotation Invariant” CoordsRotation Invariant  Coords

The representation should take into account local rotations + scale

δi = L(vi) Tiδi = L(v’i)

Problem: Tidepends on deformed position v’ii p p i

Page 29: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Solution: Implicit TransformationsSolution: Implicit Transformations

Idea: solve for local transformation and deformed surface simultaneouslyy

Transformationof the local frame

Page 30: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

SimilaritiesSimilarities

Restrict Ti to “good” transformations = rotation + scale  similarity transformationy

Similarity Transformation

Page 31: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

SimilaritiesSimilarities

• Conditions on Ti to be a similarity matrix?

• Linear in 2D:A ili i blAuxiliary variables

Uniform  Rotation + scale translation

Page 32: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Similarities 2DSimilarities 2D

Page 33: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Similarities 3D caseSimilarities – 3D case

li i 3• Not linear in 3D:

• Linearize by dropping the quadratic term– Effectively: only small rotations are handled

Page 34: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Laplacian CoordinatespRealtime?

• Need to solve a linear system each frame

(ATA)x = ATb

• Precompute sparse Cholesky factorizationPrecompute sparse Cholesky factorization

• Only back substitution per frame

Page 35: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Some ResultsSome Results

Page 36: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Some ResultsSome Results

Page 37: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Limitations: Large RotationsLimitations: Large Rotations

Page 38: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

How to Find the Rotations?How to Find the Rotations?

• Laplacian coordinates – solve for them– Problem: not linear

A th h t t ti f• Another approach: propagate rotations from handles

Page 39: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Rotation PropagationRotation Propagation

• Compute handle’s “deformation gradient”

• Extract rotation and scale/shear componentsExtract rotation and scale/shear components

• Propagate damped rotations over ROI

Page 40: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Deformation GradientDeformation Gradient

• Handle has been transformed affinely

• Deformation gradient is:

• Extract rotation R and scale/shear S

Page 41: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

Smooth PropagationSmooth Propagation

h l f ld [ ]• Construct smooth scalar field [0,1]– α(x)=1 Full deformation (handle)– α(x)=0 No deformation (fixed part)– α(x)∈[0,1] Damp transformation (in between)( ) [ , ] p ( )

• Linearly damp scale/shear:• Linearly damp scale/shear: S(x)= α(x)S(handle)L l d t ti• Log scale damp rotation: R(x) = exp(α(x)log(R(handle))

Page 42: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

LimitationsLimitations

• Works well for rotations

• Translations don’t change deformation gradient– “Translation insensitivity”

Page 43: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

The Curse of RotationsThe Curse of Rotations

• Can’t solve for them directly using a linear  systemy

• Can’t propagate if the handles don’t rotate

• Some linear methods work for rotations

• Some work for translations

• None work for both

Page 44: 18 Deformation 1 - Computer Graphics at Stanford …graphics.stanford.edu/courses/.../LectureSlides/18_Deformation_1.pdf · Approaches • Surface deformation – Shapp e is emppyty

The Curse of RotationsThe Curse of Rotations

l• Non linearmethods workfor both large rotations andtranslation only

• No free lunch:much moremuch more expensive