cs 395: adv. computer graphics week 6 overview: shape manipulation watt : chapter 2.5 jack tumblin...

18
CS 395: Adv. Computer CS 395: Adv. Computer Graphics Graphics Week 6 Overview: Week 6 Overview: Shape Manipulation Shape Manipulation Watt : Chapter 2.5 Watt : Chapter 2.5 Jack Tumblin Jack Tumblin [email protected] [email protected]

Post on 22-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

CS 395: Adv. Computer GraphicsCS 395: Adv. Computer Graphics

Week 6 Overview:Week 6 Overview:Shape ManipulationShape Manipulation

Watt : Chapter 2.5Watt : Chapter 2.5

Jack TumblinJack [email protected]@cs.northwestern.edu

Shape ManipulationShape Manipulation

How can we:How can we:

• Simplify a shape? 10Mpoly Simplify a shape? 10Mpoly 500 poly? 500 poly?

• Check Visibility? Check Visibility? discard many Mpolys never seen?discard many Mpolys never seen?

• Make a shape from a ‘cloud’ of points? Make a shape from a ‘cloud’ of points?

• Warp from Shape A to Shape B?Warp from Shape A to Shape B?

Model Simplification Model Simplification

The idea:The idea:– It should look the same, but…It should look the same, but…

– have fewer polys.have fewer polys.

–In general, it works!In general, it works!

–Only limited user control.Only limited user control.

–Some surface mappings handled poorly.Some surface mappings handled poorly.Watson 2000Watson 2000

Model SimplificationModel Simplification

Many 3D Models are too big to: Many 3D Models are too big to:

• Display interactively Display interactively

• DisplayDisplay at all (!) at all (!)

Sources:Sources:• 3D scanning – Laser Time-of-Flight Reflectometry3D scanning – Laser Time-of-Flight Reflectometry• Visualization of scientific data Visualization of scientific data • Huge CAD/CAM efforts:Huge CAD/CAM efforts:

– 100+ man-years: plants, ships and planes 100+ man-years: plants, ships and planes

• Procedural models: grass, trees, cities, etc.Procedural models: grass, trees, cities, etc.

Edge Collapse / Vertex SplitEdge Collapse / Vertex Split

Elemental Simplify Operation (by consensus)Elemental Simplify Operation (by consensus)

‘‘Edge Collapse’Edge Collapse’

•choose edgechoose edge•2 old 2 old 1 new vertex1 new vertex•update edges, facesupdate edges, faces

‘‘Vertex Split’Vertex Split’

•choose edge pairchoose edge pair•1 old1 old2new vertices2new vertices•update edges, facesupdate edges, faces

Model Simplification Model Simplification Basic approach:Basic approach:

– Choose a simplifier: (e.g. edge collapse)Choose a simplifier: (e.g. edge collapse)– Choose a quality measure; Choose a quality measure;

(a 'cost' for the operator)(a 'cost' for the operator)– Use a greedy algorithm: Use a greedy algorithm:

(edge collapse example)(edge collapse example)• Sort edges by costSort edges by cost• Loop until simple enough:Loop until simple enough:• Collapse least-cost edgeCollapse least-cost edge• Re-sort affected nearby edgesRe-sort affected nearby edges

Quick Taxonomy of simplifying methods:Quick Taxonomy of simplifying methods:Spatial Clustering:Spatial Clustering:

Merge Spatial-nearby clusters of verts, edges, facesMerge Spatial-nearby clusters of verts, edges, facesEarliest (Rossignac); very fast, but poor qualityEarliest (Rossignac); very fast, but poor quality

Pairwise merge algorithms: Pairwise merge algorithms: Merge adjacent face pair, Merge adjacent face pair,

edge pair, edge pair, or vertex pair(edge collapse: Hoppe, Garland)or vertex pair(edge collapse: Hoppe, Garland)

Slower, but often best qualitySlower, but often best qualityCan be tricky for non-triangle faces Can be tricky for non-triangle faces Opinion: only edge collapse used now.Opinion: only edge collapse used now.

Pruning algorithms: Pruning algorithms: vertex deletion (& delete adjacent edges)vertex deletion (& delete adjacent edges)edge deletion (& delete empty vertices)edge deletion (& delete empty vertices)face deletion (& replace with a vertex)face deletion (& replace with a vertex)

Opinion: Research community converged on edge collapseOpinion: Research community converged on edge collapse

Surface fitting Surface fitting Related ProblemsRelated ProblemsLevel of detail (LOD) Level of detail (LOD)

How to use simplified models in interactive display? How to use simplified models in interactive display?

Measuring visual fidelity Measuring visual fidelity Which primitive simplification preserves appearance? Which primitive simplification preserves appearance?

Surface fitting:Surface fitting:We have a cloud of points from a scanning apparatus We have a cloud of points from a scanning apparatus How do we turn these points into a surface model? How do we turn these points into a surface model? Basic example (Turk & Levoy) Basic example (Turk & Levoy) Make multiple partial scans Make multiple partial scans Fit surface to each scan (fairly simple) Fit surface to each scan (fairly simple) Repeat Repeat Choose two partial scans Choose two partial scans Align them to one another using iterated closest points Align them to one another using iterated closest points Join the surfaces topologically Join the surfaces topologically Tune the local geometry with comparisons to point cloud Tune the local geometry with comparisons to point cloud Until all partial scans are joined Until all partial scans are joined Critique Critique +: widely used +: widely used -: didn’t address reflectance & surface properties -: didn’t address reflectance & surface properties -: what about parametric surfaces? -: what about parametric surfaces?

Shape comparison:Shape comparison:Problem Problem How to sort & and query for shapes? How to sort & and query for shapes? Basic example (Osada, Funkhouser et al) Basic example (Osada, Funkhouser et al) Define a shape function Define a shape function Should be invariant under rigid transforms, small detail variation Should be invariant under rigid transforms, small detail variation E.g. distance between two random model points E.g. distance between two random model points E.g. volume of tetrahedron between four model points E.g. volume of tetrahedron between four model points Use it to create a shape distribution Use it to create a shape distribution Make a lot of random samples of shape function Make a lot of random samples of shape function Form a histogram Form a histogram Fit a piecewise linear probability distribution function Fit a piecewise linear probability distribution function Result, a vector with N integers Result, a vector with N integers Compare shape distributions Compare shape distributions Use existing function comparison approaches Use existing function comparison approaches They use Minkowski sum: They use Minkowski sum: Shape distr A, B Shape distr A, B sum((A-B)^N)^(1/N) sum((A-B)^N)^(1/N) Critique Critique +: Good for rough classification +: Good for rough classification -: Not good at details -: Not good at details Subproblems Subproblems

What is a good shape function? What is a good shape function? How to query? How to query?

Model Simplification: Taxonomy IModel Simplification: Taxonomy I

Quick Taxonomy of simplifying methods:Quick Taxonomy of simplifying methods:• Spatial Clustering:Spatial Clustering:

– Merge chosen clusters of verts, edges, facesMerge chosen clusters of verts, edges, faces– Earliest (Rossignac); Earliest (Rossignac); – easy, very fast, but poor qualityeasy, very fast, but poor quality

• Pairwise merge algorithms: Pairwise merge algorithms: – Merge adjacent face pair, edge pair, Merge adjacent face pair, edge pair,

or vertex pair or vertex pair (edge collapse: Hoppe,Garland)(edge collapse: Hoppe,Garland)– Slower, but often best qualitySlower, but often best quality– Can be tricky for non-triangle faces Can be tricky for non-triangle faces ..

Model Simplification:Taxonomy IIModel Simplification:Taxonomy II

• Pruning algorithms: Pruning algorithms: – vertex deletion (& delete adjacent edges)vertex deletion (& delete adjacent edges)

– edge deletion (& delete empty vertices)edge deletion (& delete empty vertices)

– face deletion (& replace with a vertex)face deletion (& replace with a vertex)

– too crude; changes too large!too crude; changes too large!

– Opinion:Opinion: Research community Research community converged on converged on edge collapseedge collapse; only edge ; only edge collapse matters anymore!collapse matters anymore!

Related ProblemsRelated Problems

• Level of detail (LOD) Level of detail (LOD) – How to use simplified models in How to use simplified models in

interactive display? interactive display?

• Measuring visual fidelity Measuring visual fidelity – Which simplifier best preserves Which simplifier best preserves

the visual appearance? the visual appearance?

• Surface fitting:Surface fitting:– 3D scanner gives a cloud of points3D scanner gives a cloud of points

– How do we make a surface model? How do we make a surface model?

Related ProblemsRelated Problems

• Mesh Zippering (Turk & Levoy 1996) Mesh Zippering (Turk & Levoy 1996) – Make multiple partial scans Make multiple partial scans – Fit surface to each scan (fairly simple) Fit surface to each scan (fairly simple) – Choose two partial scans Choose two partial scans – Align them using iterated closest points Align them using iterated closest points – Join the surfaces topologically Join the surfaces topologically – Tune the local geometry; compare to point cloud Tune the local geometry; compare to point cloud

• Critique +: widely used Critique +: widely used – -- didn’t address reflectance & surface properties -- didn’t address reflectance & surface properties – -- what about parametric surfaces?-- what about parametric surfaces?

Related ProblemsRelated Problems• Basic example (Turk & Levoy) Basic example (Turk & Levoy)

– Make multiple partial scans Make multiple partial scans – Fit surface to each scan (fairly simple) Fit surface to each scan (fairly simple) – Choose two partial scans Choose two partial scans – Align them using iterated closest points Align them using iterated closest points – Join the surfaces topologically Join the surfaces topologically – Tune the local geometry; compare to point cloud Tune the local geometry; compare to point cloud

• Critique +: widely used Critique +: widely used – -- didn’t address reflectance & surface properties -- didn’t address reflectance & surface properties – -- what about parametric surfaces? -- what about parametric surfaces?

Shape comparison:Shape comparison:Problem Problem How to sort & and query for shapes? How to sort & and query for shapes? Basic example (Osada, Funkhouser et al) Basic example (Osada, Funkhouser et al) Define a shape function Define a shape function Should be invariant under rigid transforms, small detail variation Should be invariant under rigid transforms, small detail variation E.g. distance between two random model points E.g. distance between two random model points E.g. volume of tetrahedron between four model points E.g. volume of tetrahedron between four model points Use it to create a shape distribution Use it to create a shape distribution Make a lot of random samples of shape function Make a lot of random samples of shape function Form a histogram Form a histogram Fit a piecewise linear probability distribution function Fit a piecewise linear probability distribution function Result, a vector with N integers Result, a vector with N integers Compare shape distributions Compare shape distributions Use existing function comparison approaches Use existing function comparison approaches They use Minkowski sum: They use Minkowski sum: Shape distr A, B Shape distr A, B sum((A-B)^N)^(1/N) sum((A-B)^N)^(1/N) Critique Critique +: Good for rough classification +: Good for rough classification -: Not good at details -: Not good at details Subproblems Subproblems

What is a good shape function? What is a good shape function? How to query? How to query?

Surface fittingSurface fitting

Surface fitting: Find surface from a cloud of pointsSurface fitting: Find surface from a cloud of points

ExampleExample

1 2

3

13,000 points13,000 points

Hoppe ‘94

3D Morphing3D MorphingChange shape Change shape AA to shape to shape BB (Turk/O’Brien99) (Turk/O’Brien99)

Model SimplificationModel Simplification Basic approach Basic approach

Choose a simplifier: Choose a simplifier: e.g. edge collapse e.g. edge collapse Choose a quality measure; a 'cost' for the operatorChoose a quality measure; a 'cost' for the operatorUse a greedy algorithm: (edge collapse example)Use a greedy algorithm: (edge collapse example)Sort edges by costSort edges by costLoop until simple enough:Loop until simple enough:Collapse least-cost edgeCollapse least-cost edgeRe-sort affected nearby edgesRe-sort affected nearby edges

Quick Taxonomy of simplifying methods:Quick Taxonomy of simplifying methods:Spatial Clustering:Spatial Clustering:

Merge Spatial-nearby clusters of verts, edges, facesMerge Spatial-nearby clusters of verts, edges, facesEarliest (Rossignac); very fast, but poor qualityEarliest (Rossignac); very fast, but poor quality

Pairwise merge algorithms: Pairwise merge algorithms: Merge adjacent face pair, Merge adjacent face pair, edge pair, edge pair, or vertex pair(edge collapse: Hoppe, Garland)or vertex pair(edge collapse: Hoppe, Garland)Slower, but often best qualitySlower, but often best qualityCan be tricky for non-triangle faces Can be tricky for non-triangle faces Opinion: only edge collapse used now.Opinion: only edge collapse used now.

Pruning algorithms: Pruning algorithms: vertex deletion (& delete adjacent edges)vertex deletion (& delete adjacent edges)edge deletion (& delete empty vertices)edge deletion (& delete empty vertices)face deletion (& replace with a vertex)face deletion (& replace with a vertex)

Opinion: Research community converged on edge collapseOpinion: Research community converged on edge collapse

Surface fitting Surface fitting Related ProblemsRelated ProblemsLevel of detail (LOD) Level of detail (LOD)

How to use simplified models in interactive display? How to use simplified models in interactive display?

Measuring visual fidelity Measuring visual fidelity Which primitive simplification preserves appearance? Which primitive simplification preserves appearance?

Surface fitting:Surface fitting:We have a cloud of points from a scanning apparatus We have a cloud of points from a scanning apparatus How do we turn these points into a surface model? How do we turn these points into a surface model? Basic example (Turk & Levoy) Basic example (Turk & Levoy) Make multiple partial scans Make multiple partial scans Fit surface to each scan (fairly simple) Fit surface to each scan (fairly simple) Repeat Repeat Choose two partial scans Choose two partial scans Align them to one another using iterated closest points Align them to one another using iterated closest points Join the surfaces topologically Join the surfaces topologically Tune the local geometry with comparisons to point cloud Tune the local geometry with comparisons to point cloud Until all partial scans are joined Until all partial scans are joined Critique Critique +: widely used +: widely used -: didn’t address reflectance & surface properties -: didn’t address reflectance & surface properties -: what about parametric surfaces? -: what about parametric surfaces?

Shape comparison:Shape comparison:Problem Problem How to sort & and query for shapes? How to sort & and query for shapes? Basic example (Osada, Funkhouser et al) Basic example (Osada, Funkhouser et al) Define a shape function Define a shape function Should be invariant under rigid transforms, small detail variation Should be invariant under rigid transforms, small detail variation E.g. distance between two random model points E.g. distance between two random model points E.g. volume of tetrahedron between four model points E.g. volume of tetrahedron between four model points Use it to create a shape distribution Use it to create a shape distribution Make a lot of random samples of shape function Make a lot of random samples of shape function Form a histogram Form a histogram Fit a piecewise linear probability distribution function Fit a piecewise linear probability distribution function Result, a vector with N integers Result, a vector with N integers Compare shape distributions Compare shape distributions Use existing function comparison approaches Use existing function comparison approaches They use Minkowski sum: They use Minkowski sum: Shape distr A, B Shape distr A, B sum((A-B)^N)^(1/N) sum((A-B)^N)^(1/N) Critique Critique +: Good for rough classification +: Good for rough classification -: Not good at details -: Not good at details Subproblems Subproblems

What is a good shape function? What is a good shape function? How to query? How to query?

Other Shape ManipulationsOther Shape Manipulations

Deforming Polygonal Shapes:Deforming Polygonal Shapes:

‘‘Bones’ and skin Bones’ and skin

Space Warp(don't bend object; bend space)Space Warp(don't bend object; bend space)

'Growing Skin‘'Growing Skin‘

Deforming Implicit surfaces (bend space)Deforming Implicit surfaces (bend space)

Combinatoric ExplosionCombinatoric Explosion

How many different ways to simplify? How many different ways to simplify? TOO MANY! TOO MANY!

• (# of vertex removal sequences) *(valence)(# of vertex removal sequences) *(valence)• Recall that valence== #edges that end at a vertex. Recall that valence== #edges that end at a vertex.

• or formally, O(N! * N/E) or formally, O(N! * N/E)

• Also; O(N) new vertex placementsAlso; O(N) new vertex placements

Good Simplification Quality metrics needed!Good Simplification Quality metrics needed!

Simplification HierarchySimplification Hierarchy

What is it?What is it?• Binary Tree of Edge CollapsesBinary Tree of Edge Collapses• Graph node==vertex, Graph Edge==collapse Graph node==vertex, Graph Edge==collapse • Leaf node==original mesh vertex;Leaf node==original mesh vertex;• Parent node == new vertex from edge collapseParent node == new vertex from edge collapse

Why use it?Why use it?• Can pre-compute itCan pre-compute it• Load entire graph (cheap)Load entire graph (cheap)• Graph Cut quickly selects Graph Cut quickly selects

a pre-computed,a pre-computed,locally - simplified modellocally - simplified model

Local SimplificationLocal Simplification

Many PolygonsMany Polygons(far from the(far from thegraph root)graph root)

Few PolygonsFew Polygons(near the graph root)(near the graph root)