Regular subdivision Loop 87 Catmull&Clark 78 Zorin&Schröder 01

Slides:



Advertisements
Similar presentations
Extended Gaussian Images
Advertisements

Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 14: Review / Subdivision Ravi Ramamoorthi Slides courtesy.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 10 Ravi Ramamoorthi
Multiresolution Analysis for Surfaces of Arbitrary Topological Type Michael Lounsbery Michael Lounsbery Alias | wavefront Alias | wavefront Tony DeRose.
Results / Compared to Relief Mapping It does not scale linearly with screen coverage as does the other techniques. However, for larger displacements, it.
On Triangle/Quad Subdivision Scott Schaefer and Joe Warren TOG 22(1) 28 – 36, 2005 Reporter: Chen zhonggui
Subdivision Curves & Surfaces and Fractal Mountains. CS184 – Spring 2011.
CS Peter Schröder Subdivision I: The Basic Ideas.
Surfaces Chiew-Lan Tai. Surfaces 2 Reading Required Hills Section Hearn & Baker, sections 8.11, 8.13 Recommended Sections 2.1.4, , 3D Computer.
INFORMATIK Differential Coordinates for Interactive Mesh Editing Yaron Lipman Olga Sorkine Daniel Cohen-Or David Levin Tel-Aviv University Christian Rössl.
A Sketch-Based Interface for Detail-Preserving Mesh Editing Andrew Nealen Olga Sorkine Marc Alexa Daniel Cohen-Or.
Fractal Mountains, Splines, and Subdivision Surfaces Jordan Smith UC Berkeley CS184.
Pauly, Keiser, Kobbelt, Gross: Shape Modeling with Point-Sampled GeometrySIGGRAPH 2003 Shape Modeling with Point-Sampled Geometry Mark Pauly Richard Keiser.
Polygonal Mesh – Data Structure and Smoothing
Normal based subdivision scheme for curve and surface design 杨勋年
Content Subdivision First some basics (control point polygon, mesh)
Subdivision Overview Subdivision is a two part process Control Mesh
FiberMesh: Designing Freeform Surfaces with 3D Curves
11/08/00 Dinesh Manocha, COMP258 Subdivision Curves & Surfaces Work of G. de Rham on Corner Cutting in 40’s and 50’s Work of Catmull/Clark and Doo/Sabin.
Introduction to Subdivision Surfaces. Subdivision Curves and Surfaces 4 Subdivision curves –The basic concepts of subdivision. 4 Subdivision surfaces.
1 Free-Form Deformations Free-Form Deformation of Solid Geometric Models Fast Volume-Preserving Free Form Deformation Using Multi-Level Optimization Free-Form.
Smooth Spline Surfaces over Irregular Topology Hui-xia Xu Wednesday, Apr. 4, 2007.
11/30/04© University of Wisconsin, CS559 Fall 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
CSE554Laplacian DeformationSlide 1 CSE 554 Lecture 8: Laplacian Deformation Fall 2012.
Subdivision surfaces Construction and analysis Martin Reimers CMA/IFI, University of Oslo September 24th 2004.
Subdivision/Refinement Dr. S.M. Malaek Assistant: M. Younesi.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Quadric Error Metrics 1/20 Quadric Error Metrics.
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
Manuel Mesters - Subdivision Surfaces computer graphics & visualization Seminar Computer Graphics Geometric representation and processing: Subdivision.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
1 Surface Applications Fitting Manifold Surfaces To 3D Point Clouds, Cindy Grimm, David Laidlaw and Joseph Crisco. Journal of Biomechanical Engineering,
Geometry Images Xiang Gu Harvard University Steven J. Gortler Harvard university Hugues Hoppe Microsoft Research Some slides taken from Hugues Hoppe.
Mesh Data Structure. Meshes Boundary edge: adjacent to 1 face Regular edge: adjacent to 2 faces Singular edge: adjacent to >2 faces Mesh: straight-line.
1 Adding charts anywhere Assume a cow is a sphere Cindy Grimm and John Hughes, “Parameterizing n-holed tori”, Mathematics of Surfaces X, 2003 Cindy Grimm,
INFORMATIK Laplacian Surface Editing Olga Sorkine Daniel Cohen-Or Yaron Lipman Tel Aviv University Marc Alexa TU Darmstadt Christian Rössl Hans-Peter Seidel.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
Andrew Nealen / Olga Sorkine / Mark Alexa / Daniel Cohen-Or SoHyeon Jeong 2007/03/02.
1 Wavelets on Surfaces By Samson Timoner May 8, 2002 (picture from “Wavelets on Irregular Point Sets”) In partial fulfillment of the “Area Exam” doctoral.
Subdivision Surfaces Ref: Subdivision Surfaces in Character Animation, DeRose et. al, SIGGRAPH98.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 8 Ravi Ramamoorthi
Lapped Solid Textrues Filling a Model with Anisotropic Textures
Lee Byung-Gook Dongseo Univ.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Subdivision Surfaces Greg Humphreys University of Virginia CS 445, Fall 2003.
11/26/02(C) University of Wisconsin Last Time BSplines.
Subdivision Surfaces Dr. Scott Schaefer.
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Subdivision surfaces.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Subdivision Schemes. Center for Graphics and Geometric Computing, Technion What is Subdivision?  Subdivision is a process in which a poly-line/mesh is.
1 Spherical manifolds for hierarchical surface modeling Cindy Grimm.
Vector 2.
Evgeny Lipovetsky School of Computer Sciences, Tel-Aviv University
CENG 789 – Digital Geometry Processing 04- Mesh Data Structures
Mesh Modelling With Curve Analogies
Variational Tetrahedral Meshing
Subdivision curves.
Advanced Computer Graphics
CSE 554 Lecture 9: Laplacian Deformation
© University of Wisconsin, CS559 Fall 2004
CSC461: Lecture 23 Shading Computation
Subdivision curves.
The Variety of Subdivision Schemes
3D Modeling, Graphics, and Animation
Chapter III Modeling.
Jeff Ballard Nick Rasmussen
Iso-Surface extraction from red and green samples on a regular lattice
3D Modeling, Graphics, and Animation
Subdivision Surfaces 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Jeff Ballard Nick Rasmussen
Last Time B-splines Project 3 was made available
Presentation transcript:

Regular subdivision Loop 87 Catmull&Clark 78 Zorin&Schröder 01 Use split&tweak curve subdivision to create smooth surfaces Presti

T-mesh subdivision Assume Triangle mesh with arbitrary genus

Lecture Objectives Learn how to implement a regular subdivision for manifold triangle meshes using a butterfly scheme to compute the new vertices at each stage. Reading: Lear how to extend the above to an adaptive subdivision by studying the research paper: “A Sub-Atomic Subdivision Approach” by S. Seeger, K. Hormann G. Hausler and G. Greiner

Subdivision Insert a new vertex in the middle of each edge Split each triangle into 4 triangles

An example of 2 iterations on a tetrahedron Repeat the operation several times BUT, at each step, you will adjust the position of the new vertices, using the butterfly rule

Butterfly mask To compute the position of the new (mid-edge) point, multiply its neighbors by the corresponding coefficients and add them up.

A more intuitive formulation First insert the new points in the middle of the edges m = average(f) Then compute adjustment vectors d = (average(s) – average(t))/4 Then adjust all the m points by displacing them by the corresponding d m = m + d Then compute the new triangles m f s t equivalent

Subdivision a triangle mesh k times Read the input file and construct the X, Y, Z, V tables Allocate X[N4k], Y[N4k], and Z[N4k] and fill the first N entries Repeat the following process k times Compute the O table For each corner c, find the opposite corner b, then O[c]:=b; O[b]:=c; Compute mid-edge points For each corner c do n+=1; (X[n],Y[n],Z[n]):=average(f)+(average(s) – average(t))/4; M[c]:=M[c.o]:=n; Compute a new V-table (4 times longer than the previous one) V[n++]=c.v; V[n++]=c.p.m.v; … // 12 entries Write the X, Y, Z and the V tables on file

Input/output (file) format N # the number of vertices x[0] y[0] z[0] x[1] y[1] z[1] … x[N-1] y[N-1] z[N-1] T # the number of triangles V[0] V[1] V[2] # the Integer IDs of vertices for triangle 0 V[3] V[4] V[5] # the Integer IDs of vertices for triangle 1 V[3] V[4] V[5] # the Integer IDs of vertices for triangle 2 V[6] V[7] V[8] V[3T-3] V[3T-2] V[3T-1] # the Integer IDs of vertices for triangle T-1

How to construct the O table FOR c:=0 TO 3T-2 DO FOR b:=c+1 TO 3T-1 DO IF THEN { O[c]:=b; O[b]:=c} (c.n.v==b.p.v) && (c.p.v==b.n.v)

How to access the neighbors from a corner Given a corner c, write down the complete expression for m(c) = average(f) + (average(s) – average(t))/4 using .n, .p, .o, .l, .r, and .v operators c.o.l.v c.v m(c) c.p.v c.n.v c.o.v c.r.v c.l.v c.o.r.v c s m(c) f t c m(c)= (c.n.v+c.p.v)/2+((c.v+c.0.v)/2–(c.l.v+c.r.v+c.o.l.v+c.o.r.v)/4)/4

How to split a triangle Given a corner c, write down the complete expression for the next 12 entries of V as shown using .n, .p, .o, .l, .r, and .v operators c.m.v c.v c.p.m.v c.n.m.v c.n.v c.p.v 1 2 3 4 5 6 7 8 9 10 11 12 c

Generating the V entries for 4 new triangles Write the 12 V-table entries in terms of c c.v c.p.m.v c.n.m.v c.n.v c.m.v c.p.v c..n.m.v c.m.v c.v c.p.m.v c.n.m.v c.n.v c.p.v 1 2 3 4 5 6 7 8 9 10 11 12

Complete T-mesh subdivision algorithm read k; allocate(X[4k], Y[4k], Z[4k]); for i:=0 to k–1 do read(X[i],Y[i],Z[i]); read t, allocate(V[3t]); for i:=0 to 3t–1 do read(V[i]); Allocate(O[3t],F[3t],M[3t],W[12t]); for c:=0 to 3t–2 do for b:=c+1 to 3t-1 do if (c.n.v==b.p.v) && (c.p.v ==b.n.v) then {O[c]:=b; O[b]:=c}; i:=k–1; for c:=0 to 3t–1 do {M[c]:=M[c.o]:=++i; (X[i],Y[i],Z[i]):=(c.n.v+c.p.v)/2+((c.v+c.o.v)/2–(c.l.v+c.r.v+c.o.l.v+c.o.r.v)/4)/4}; i:=0; for c:=0 to 3t–1 do if c.f then { F[c]:=F[c.n]:=F[c.p]:=false; W[i++]:= c.v; W[i++]:= c.p.m.v; W[i++]:= c.n.m.v; W[i++]:= c.p.m.v; W[i++]:= c.n.v; W[i++]:= c.m.v; W[i++]:= c.n.m.v; W[i++]:= c.m.v; W[i++]:= c.p.v; W[i++]:= c.m.v; W[i++]:= c.n.m.v; W[i++]:= c.p.m.v}; write (4k, X, Y, Z, 4t, W);

Rebuilding the O table directly (Stephen Ingram) # this program takes a T-mesh and computes a subdivided T-mesh using the butterfly subdivision read k; allocate(X[4k], Y[4k], Z[4k]); for i:=0 to k-1 do read(X[i],Y[i],Z[i]); # k = number of vertices read t, allocate(V[3t], O[3t]); for i:=0 to 3t-1 do read(V[i]); # t = number of triangles for i:=0 to 3t-1 do read(O[i]); #read in opposites from file allocate(nO[12t], F[3t], M[3t], W[12t]); # F = true/false it has been fourthed, M = midpoints, nO is new Opposite array # compute each point's midpoint and its opposite point's midpoint (the same) i:=k-1; for c:=0 to 3t-1 do {M[c]:=M[c.o]:=++i; (X[i],Y[i],Z[i]):=(c.n.v+c.p.v)/2+((c.v+c.o.v)/2-(c.l.v+c.r.v+c.o.l.v+c.o.r.v)/4)/4}; # compute triangles for new surface i:=0; for c:=0 to 3t-1 do if c.f then { F[c]:=F[c.n]:=F[c.p]:=false; # to avoid recalculating a new triangle W[i]:= c.v; nO[i++]:=c.m.v; W[i]:= c.p.m.v; nO[i++]:=c.n.o.p.m.v; W[i]:= c.n.m.v; nO[i++]:=c.p.o.n.m.v;# W = array of new triangles W[i]:= c.p.m.v; nO[i++]:=c.p.v; W[i]:= c.n.v; nO[i++]:=c.n.m.v; W[i]:= c.m.v; nO[i++]:=c.v; W[i]:= c.n.m.v; nO[i++]:=c.n.v; W[i]:= c.m.v; nO[i++]:=c.n.o.n.m.v; W[i]:= c.p.v; nO[i++]:=c.p.m.v; W[i]:= c.m.v; nO[i++]:=c.v; W[i]:= c.p.m.v; nO[i++]:=c.p.v; }; write (4k, X, Y, Z, 4t, W, nO);

Subdivision in Processing: Corners int t (int c) {int r=int(c/3); return(r);}; int n (int c) {int r=3*int(c/3)+(c+1)%3; return(r);}; int p (int c) {int r=3*int(c/3)+(c+2)%3; return(r);}; int v (int c) {return(V[c]);}; int o (int c) {return(O[c]);}; int l (int c) {return(o(n(c)));}; int r (int c) {return(o(p(c)));}; // indices to mid-edge vertices associated with corners int w (int c) {return(W[c]);}; boolean border (int c) {return(O[c]==-1);}; // if has no opposite // shortcut to get the point of the vertex v(c) of corner c pt g (int c) {return(G[V[c]]);};

Subdivision in Processing: O table // sets O table from V, assumes consistent orientation of triangles void computeO() { // init O table to -1: has no opposite (i.e. is a border corner) for (int i=0; i<3*nt; i++) {O[i]=-1;}; // for each corner i, for each other corner j for (int i=0; i<3*nt; i++) { for (int j=i+1; j<3*nt; j++) { if( (v(n(i))==v(p(j))) && (v(p(i))==v(n(j))) ) { O[i]=j; O[j]=i;};};}; // make i and j opposite if they match };

Subdivision in Processing: Split edges // creates a new vertex for each edge and stores its ID // in the W of the corner (and of its opposite if any) void splitEdges() {for (int i=0; i<3*nt; i++) { // for each corner i if(border(i)) {G[nv]=midPt(g(n(i)),g(p(i))); W[i]=nv++;} else {if(i<o(i)) {G[nv]=midPt(g(n(i)),g(p(i))); W[o(i)]=nv; W[i]=nv++; }; }; // if this corner is the first to see the edge };

Subdivision in Processing: Bulge edges // tweaks new mid-edge vertices according to the Butterfly mask void bulge() { for (int i=0; i<3*nt; i++) { // no tweak for mid-vertices of border edges if((!border(i))&&(i<o(i))) { G[W[i]].addScaledVec(0.25, midPt(midPt(g(l(i)),g(r(i))), midPt(g(l(o(i))),g(r(o(i)))) ).vecTo(midPt(g(i),g(o(i))))); };

Subdivision in Processing: Split triangles void splitTriangles() { // splits each triangle into 4 for (int i=0; i<3*nt; i=i+3) { V[3*nt+i]=v(i); V[n(3*nt+i)]=w(p(i)); V[p(3*nt+i)]=w(n(i)); V[6*nt+i]=v(n(i)); V[n(6*nt+i)]=w(i); V[p(6*nt+i)]=w(p(i)); V[9*nt+i]=v(p(i)); V[n(9*nt+i)]=w(n(i)); V[p(9*nt+i)]=w(i); V[i]=w(i); V[n(i)]=w(n(i)); V[p(i)]=w(p(i)); }; nt=4*nt;

Subdivision in Processing: Butterfly void keyPressed() { … if (key=='B') { splitEdges(); bulge(); splitTriangles(); computeO(); }; butterfly

Butterfly subdivision & smoothing refine smoothing

Smoothing in Processing: Valences void computeValence() { // caches valence of each vertex // resets the valences to 0 for (int i=0; i<nv; i++) {Nv[i].setTo(0,0,0); valence[i]=0;}; for (int i=0; i<3*nt; i++) {valence[v(i)]++; }; };

Smoothing in Processing: Normals // computes the vertex normals as sums of the normal vectors // of incident tirangles scaled by area/2 void computeVertexNormals() { computeValence(); for (int i=0; i<3*nt; i++) {Nv[v(p(i))].add(g(p(i)).vecTo(g(n(i))));}; for (int i=0; i<nv; i++) {Nv[i].div(valence[i]);}; };

Smoothing in Processing: Tuck // displaces each vertex by a fraction s of its normal void tuck(float s) { for (int i=0; i<nv; i++) {G[i].addScaledVec(s,Nv[i]);}; };

Smoothing in Processing: Smooth void keyPressed() { … // bi-laplace smoothing if (key=='S') { computeVertexNormals(); tuck(0.6); tuck(-0.6); }; smoothing

Modified Butterfly scheme “Interpolating Subdivision for Meshes with Arbitrary Topology”, Zorin, Schröder, Sweldens

Other subdivision schemes Loop subdivision Move mid-edge points 1/4 towards the average of their second neighbors (s) Move the original vertices towards the average of their new neighbors. Loop suggests to use =(5/8-(3/8+(cos(2/k))/4))/k

Adaptive subdivision What if you need to subdivide more in one areas? “A Sub-Atomic Subdivision Approach” by S. Seeger, K. Hormann G. Hausler and G. Greiner

Subdivision of non-triangle meshes Insert mid-edge points. Remove old vertices J. Peters, U. Reif, The Simplest Subdivision Scheme for smoothing polyhedra. 16(4), ToG 97.

What you must remember That regular subdivision multiplies the number of triangles and vertices by 4 That the butterfly subdivision computes edge-midpoints using the averages of first, second, and third neighbors (f, s, t): m(c) = average(f) + (average(s) – average(t))/4 Our high-level approach algorithm for computing the XYZ’ and V’ tables for one level of subdivision. The fact that the butterfly subdivision interpolates the original vertices How to implement an adaptive Butterfly subdivision How to perform a Loop subdivision

Examples of questions for exams How is the midpoint of edge E computed in the butterfly subdivision scheme given a corner c at the opposite tip of one of the two triangles incident upon E? Is the Butterfly subdivision interpolating the original vertices? Justify/prove your answer. How many vertices are introduced by three levels of butterfly subdivision to a zero-genus mesh with V vertices? What is the influence of one of the vertices of the original triangle mesh on the surface resulting from repeatedly applying the regular Butterfly subdivision? (Hint, each one of the original triangles is subdivided into 4, then 16, and so on. Say that repeated subdivision maps a triangle into a curved patch. Obviously, each vertex of the original mesh influences the patches of the triangles incident upon it. Does it influence more?

A Sketch-Based Interface for Detail-Preserving Mesh Editing Andrew Nealen Olga Sorkine Marc Alexa Daniel Cohen-Or

Sketch-Based Interfaces and Modeling (Some) previous work SKETCH [Zeleznik et al. 96] Teddy [Igarashi et al. 99 and 03] Variational implicits [Karpenko et al. 02] Relief [Bourguignon et al. 04] Sketching mesh deformations [Kho and Garland 05] Parametrized objects [Yang et al. 05] Many, many more... and (hopefully) more to come!

Silhouette Sketching Approximate sketching Balance weighting between detail and positional constraints

Silhouette Sketching Approximate sketching Balance weighting between detail and positional constraints

Inspiration and Motivation [Botsch and Kobbelt 04] [Sorkine et al. 04] The (affine) handle metaphor Used in (almost) every editing tool Nice, but can be unintuitive for specific editing tasks Laplacian Mesh Editing Preserve local detail after imposing editing constraints [Sorkine et al. 04] [Zhou et al. 05]

Silhouette Sketching Using silhouettes as handles Detect object space silhouette Project to screen space and parametrize [0,1] Parametrize sketch [0,1] Find correspondences

Silhouette Sketching Using silhouettes as handles Detect object space silhouette Project to screen space and parametrize [0,1] Parametrize sketch [0,1] Find correspondences Use as positional constraints while retaining depth value

Silhouette Sketching What is a good silhouette? viewer