18 Deformation 1 - Computer Graphics at Stanford...

44
Deformation I

Transcript of 18 Deformation 1 - Computer Graphics at Stanford...

Deformation I

DeformationDeformation

MotivationMotivation

Easy modeling – generate new shapes by deforming existing onesg g

MotivationMotivation

Easy modeling – generate new shapes by deforming existing onesg g

MotivationMotivation

Character  posing for animation

ChallengesChallenges

l l blUser says as little as possible…

l h d d h…algorithm deduces the rest

ChallengesChallenges

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

ChallengesChallenges

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

ChallengesChallenges

Efficient!

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 ]

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

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

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

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

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

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?

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

Surface RepresentationsSurface Representations

L l i di t• Laplacian coordinates

• Edge lengths + dihedral angles

• Pyramid coordinates

• Local frames

• ….

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

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

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

DeformationDeformation

Laplacian Laplacian User Constraintscoordinates of original mesh

coordinates of deformed mesh

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 }

Laplacian CoordinatespSanity Check

• Translation invariant? 

• Rotation/scale invariant?

δiδi

iδi

ProblemProblem

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

“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

“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

Solution: Implicit TransformationsSolution: Implicit Transformations

Idea: solve for local transformation and deformed surface simultaneouslyy

Transformationof the local frame

SimilaritiesSimilarities

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

Similarity Transformation

SimilaritiesSimilarities

• Conditions on Ti to be a similarity matrix?

• Linear in 2D:A ili i blAuxiliary variables

Uniform  Rotation + scale translation

Similarities 2DSimilarities 2D

Similarities 3D caseSimilarities – 3D case

li i 3• Not linear in 3D:

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

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

Some ResultsSome Results

Some ResultsSome Results

Limitations: Large RotationsLimitations: Large Rotations

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

Rotation PropagationRotation Propagation

• Compute handle’s “deformation gradient”

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

• Propagate damped rotations over ROI

Deformation GradientDeformation Gradient

• Handle has been transformed affinely

• Deformation gradient is:

• Extract rotation R and scale/shear S

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))

LimitationsLimitations

• Works well for rotations

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

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

The Curse of RotationsThe Curse of Rotations

l• Non linearmethods workfor both large rotations andtranslation only

• No free lunch:much moremuch more expensive