Spline Surfaces, Subdivision Surfaces

Similar documents
TIEA311 Tietokonegrafiikan perusteet kevät 2018

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Computergrafik. Matthias Zwicker. Herbst 2010

Subdivision Surfaces

Subdivision Curves and Surfaces: An Introduction

Information Coding / Computer Graphics, ISY, LiTH. Splines

Subdivision Surfaces

3D Modeling techniques

INF3320 Computer Graphics and Discrete Geometry

Physically-Based Modeling and Animation. University of Missouri at Columbia

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

CS354 Computer Graphics Surface Representation IV. Qixing Huang March 7th 2018

Subdivision Surfaces

3D Modeling Parametric Curves & Surfaces

MA 323 Geometric Modelling Course Notes: Day 28 Data Fitting to Surfaces

Computer Graphics Curves and Surfaces. Matthias Teschner

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Curve Corner Cutting

UNIVERSITY OF CALGARY. Subdivision Surfaces. Advanced Geometric Modeling Faramarz Samavati

09 - Designing Surfaces. CSCI-GA Computer Graphics - Fall 16 - Daniele Panozzo

2D Spline Curves. CS 4620 Lecture 18

Curves & Surfaces. MIT EECS 6.837, Durand and Cutler

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

Curves and Surfaces 2

Surfaces for CAGD. FSP Tutorial. FSP-Seminar, Graz, November

Recursive Subdivision Surfaces for Geometric Modeling

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

Subdivision overview

Curves and Surfaces Computer Graphics I Lecture 9

CS-184: Computer Graphics

Introduction to Computer Graphics

Introduction to Geometry. Computer Graphics CMU /15-662

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Curves and Surfaces Computer Graphics I Lecture 10

CS354 Computer Graphics Surface Representation III. Qixing Huang March 5th 2018

Example: Loop Scheme. Example: Loop Scheme. What makes a good scheme? recursive application leads to a smooth surface.

Reading. Parametric surfaces. Surfaces of revolution. Mathematical surface representations. Required:

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Advanced Modeling 2. Katja Bühler, Andrej Varchola, Eduard Gröller. March 24, x(t) z(t)

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Curves D.A. Forsyth, with slides from John Hart

u 0+u 2 new boundary vertex

Free-Form Deformation and Other Deformation Techniques

Mathematical Tools in Computer Graphics with C# Implementations Table of Contents

2D Spline Curves. CS 4620 Lecture 13

G 2 Bezier Crust on Quad Subdivision Surfaces

Shape Representation Basic problem We make pictures of things How do we describe those things? Many of those things are shapes Other things include

Curves, Surfaces and Recursive Subdivision

08 - Designing Approximating Curves

Subdivision. Outline. Key Questions. Subdivision Surfaces. Advanced Computer Graphics (Spring 2013) Video: Geri s Game (outside link)

Parametric curves. Brian Curless CSE 457 Spring 2016

Curves. Computer Graphics CSE 167 Lecture 11

Intro to Curves Week 1, Lecture 2

Central issues in modelling

CS-184: Computer Graphics. Today

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Subdivision Curves and Surfaces

Subdivision surfaces. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Intro to Modeling Modeling in 3D

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Know it. Control points. B Spline surfaces. Implicit surfaces

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

Subdivision Surfaces. Homework 1: Questions/Comments?

Advanced Graphics. Subdivision Surfaces. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Lecture 4: Geometry Processing. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Polygon Meshes and Implicit Surfaces

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

Polygon Meshes and Implicit Surfaces

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Subdivision Surfaces. Homework 1: Questions on Homework? Last Time? Today. Tensor Product. What s an illegal edge collapse?

Curves and Surfaces for Computer-Aided Geometric Design

Modeling. Simulating the Everyday World

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Bezier Curves, B-Splines, NURBS

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

Sung-Eui Yoon ( 윤성의 )

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Geometry Processing & Geometric Queries. Computer Graphics CMU /15-662

11/1/13. Polygon Meshes and Implicit Surfaces. Shape Representations. Polygon Models in OpenGL. Modeling Complex Shapes

Modeling 3D Objects: Part 2

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

CS 4620 Final Exam. (a) Is a circle C 0 continuous?

Implicit Surfaces & Solid Representations COS 426

Curve and Surface Basics

CHAPTER 1 Graphics Systems and Models 3

Intro to Curves Week 4, Lecture 7

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Design considerations

Chapter 4-3D Modeling

CMSC427 Final Practice v2 Fall 2017

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Advanced Computer Graphics

Advanced Texture-Mapping Curves and Curved Surfaces. Pre-Lecture Business. Texture Modes. Texture Modes. Review quiz

(Refer Slide Time: 00:02:24 min)

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Subdivision curves and surfaces. Brian Curless CSE 557 Fall 2015

Transcription:

CS-C3100 Computer Graphics Spline Surfaces, Subdivision Surfaces vectorportal.com

Trivia Assignment 1 due this Sunday! Feedback on the starter code, difficulty, etc., much appreciated Put in your README in the submission 2

Awesome Interactive Spline Intro http://www.ibiblio.org/e-notes/splines/intro.htm 3

See something? Say something! 4

Representing Surfaces Triangle meshes Surface analogue of polylines, this is what GPUs draw Tensor Product Splines Surface analogue of spline curves Subdivision surfaces Implicit surfaces f(x,y,z)=0 Procedural e.g. surfaces of revolution, generalized cylinder From volume data (medical images, etc.) 5

Triangle Meshes What you ve used so far in Asst 1 Triangle represented by 3 vertices Pro: simple, can be rendered directly Cons: not smooth, needs many triangles to approximate smooth surfaces (tessellation) 6

Smooth Surfaces? P(t) = (1-t) 3 P 1 + 3t(1-t) 2 P 2 + 3t 2 (1-t) P 3 + t 3 P 4 What s the dimensionality of a curve? 1D! What about a surface? 7

How to Build Them? P(u) = (1-u) 3 P 1 + 3u(1-u) 2 P 2 + 3u 2 (1-u) P 3 + u 3 P 4 (Note! We relabeled t to u) 8

How to Build Them? Here s an Idea P(u) = (1-u) 3 P 1 + 3u(1-u) 2 P 2 + 3u 2 (1-u) P 3 + u 3 P 4 (Note! We relabeled t to u) 9

Here s an Idea P(u, v) = (1-u) 3 P 1 (v) + 3u(1-u) 2 P 2 (v) + 3u 2 (1-u) P 3 (v) + u 3 P 4 (v) Let s make the Pis move along curves! v=0 v=1 10

Here s an Idea P(u, v) = (1-u) 3 P 1 (v) + 3u(1-u) 2 P 2 (v) + 3u 2 (1-u) P 3 (v) + u 3 P 4 (v) Let s make the Pis move along curves! v=0 v=1 11

Here s an Idea P(u, v) = (1-u) 3 P 1 (v) + 3u(1-u) 2 P 2 (v) + 3u 2 (1-u) P 3 (v) + u 3 P 4 (v) Let s make the Pis move along curves! v=0 v=1/3 v=1 12

Here s an Idea P(u, v) = (1-u) 3 P 1 (v) + 3u(1-u) 2 P 2 (v) + 3u 2 (1-u) P 3 (v) + u 3 P 4 (v) Let s make the Pis move along curves! v=0 v=1/3 v=2/3 v=1 13

Here s an Idea P(u, v) = (1-u) 3 P 1 (v) + 3u(1-u) 2 P 2 (v) + 3u 2 (1-u) P 3 (v) + u 3 P 4 (v) Let s make the Pis move along curves! v=0 v=1/3 v=2/3 v=1 14

Here s an Idea P(u, v) = (1-u) 3 P 1 (v) + 3u(1-u) 2 P 2 (v) + 3u 2 (1-u) P 3 (v) + u 3 P 4 (v) Let s make the Pis move along curves! A 2D surface patch! s=0 s=1/3 s=2/3 s=1 15

Tensor Product Bézier Patches In the previous, Pi(v) were just some curves What if we make them Bézier curves too? 16

Tensor Product Bézier Patches In the previous, Pi(v) were just some curves What if we make them Bézier curves too? Each u=const. and v=const. curve is a Bézier curve! Note that the boundary control points (except corners) are NOT interpolated! v=0 v=1 v=2/3 17

Tensor Product Bézier Patches A bicubic Bézier surface 18

Tensor Product Bézier Patches Note that only the 4 corners are interpolated! The Control Mesh 16 control points 19

Bicubics, Tensor Product P(u,v) = B1(u) * P 1 (v) + B2(u) * P 2 (v) + B3(u) * P 3 (v) + B4(u) * P 4 (v) P4,1 P3,2 P4,2 P4,3 P4,4 Pi(v) = B1(v) * Pi,1 + B2(v) * Pi,2 + B3(v) * Pi,3 + B4(v) * Pi,4 P3,1 P2,1 P2,2 P2,3 P3,3 P2,4 P3,4 P1,4 P1,1 P1,2 P1,3 20

Bicubics, Tensor Product P(u,v) = B1(u) * P 1 (v) + B2(u) * P 2 (v) + B3(u) * P 3 (v) + B4(u) * P 4 (v) Pi(v) = B1(v) * Pi,1 + B2(v) * Pi,2 + B3(v) * Pi,3 + B4(v) * Pi,4 P (u, v) = = 4 i=1 4 i=1 B i (u) 4 j=1 4 j=1 P i,j B j (v) P i,j B i,j (u, v) B i,j (u, v) =B i (u)b j (v)

Bicubics, Tensor Product P(u,v) = B1(u) * P 1 (v) + B2(u) * P 2 (v) + B3(u) * P 3 (v) + B4(u) * P 4 (v) Pi(v) = B1(v) * Pi,1 + B2(v) * Pi,2 + B3(v) * Pi,3 + B4(v) * Pi,4 P (u, v) = 4 4 B i (u) P i,j B j (v) 16 control points Pi,j i=1 j=1 16 2D basis functions Bi,j = 4 i=1 4 j=1 P i,j B i,j (u, v) B i,j (u, v) =B i (u)b j (v)

Recap: Tensor Bézier Patches Parametric surface P(u,v) is a cubic polynomial of two variables u & v Defined by 4x4=16 control points P1,1, P1,2... P4,4 Interpolates 4 corners, approximates others 23

Tensor Product Bézier Patches Defined by 4x4=16 control points P1,1, P1,2... P4,4 Basis are product of two Bernstein polynomials: B1(u)B1(v); B1(u)B2(v);... B4(u)B4(v) 24

Questions? 25

Tangents and Normals for Patches P(u,v) is a 3D point specified by u, v The partial derivatives P/ u and are 3D vectors Both are tangent to surface at P P/ v 26

Tangents and Normals for Patches P(u,v) is a 3D point specified by u, v The partial derivatives P/ u and are 3D vectors Both are tangent to surface at P Normal is perpendicular to both, i.e., n =( P/ u) ( P/ v) P/ v n is usually not unit, so must normalize! 27

Questions? 28

Recap: Matrix Notation for Curves Cubic Bézier in matrix notation point on curve (2x1 vector) P(t) = x(t) y(t) x 1 x 2 x 3 x 4 y 1 y 2 y 3 y 4 Geometry matrix of control points P1..P4 (2 x 4) = 1 3 3 1 0 3 6 3 0 0 3 3 0 0 0 1 Spline matrix (Bernstein) Canonical power basis 1 t t 2 t 3 29

Hardcore: Matrix Notation for Patches Not required, but convenient! x coordinate of surface at (u,v) P (u, v) = 4 B i (u) 4 i=1 j=1 P i,j B j (v) P x (u, v) = P1,1 x.. P1,4 x (B 1 (u),...,b 4 (u)).. P4,1 x.. P4,4 x Row vector of basis functions (u) 4x4 matrix of x coordinates of the control points Column vector of basis functions (v) B 1 (v). B 4 (v) 30

Hardcore: Matrix Notation for Patches Curves: Surfaces: P (t) =GBT(t) P x (u, v) =T (u) T B T G x BT(v) T = power basis B = spline matrix G = geometry matrix A separate 4x4 geometry matrix for x, y, z 31

Super Hardcore: Tensor Notation You can stack the G x, G y, G z matrices into a geometry tensor of control points I.e., G k i,j = the k:th coordinate of control point Pi,j A cube of numbers! P k (u, v) =T l (u) B i l G k ij B j m T m (v) Einstein summation convention : Repeated indices are summed over (here l, m, i, j) Definitely not required, but nice! :) See http://en.wikipedia.org/wiki/multilinear_algebra 32

33

Tensor Product B-Spline Patches Bézier and B-Spline curves are both cubics => Can change between representations using matrices Consequently, you can build tensor product surface patches out of B-Splines just as well Still 4x4 control points for each patch 2D basis functions are pairwise products of B-Spline basis functions Sliding window of 4x4 points Yes, simple! 34

Tensor Product Spline Patches Pros Smooth Defined by reasonably small set of points Cons Harder to render (usually converted to triangles) Tricky to ensure continuity at patch boundaries Extensions Rational splines: Splines in homogeneous coordinates NURBS: Non-Uniform Rational B-Splines Like curves: ratio of polynomials, non-uniform location of control points, etc. 35

Utah Teapot: Tensor Bézier Splines Designed by Martin Newell 36

Cool: Displacement Mapping Not all surfaces are smooth... 37

Cool: Displacement Mapping Not all surfaces are smooth... Paint displacements on a smooth surface For example, in the direction of normal Tessellate smooth patch into fine grid, then add displacement D(u,v) to vertices Heavily used in movies, more and more in games 38

Displacement Mapping Example? Smooth base surface Displaced Surface zbrushcentral 39

Displacement Mapping Video Here, input triangles are also dynamically tessellated by the GPU http://www.youtube.com/watch?v=xdlc6taqc20 40

Subdivision Surfaces Start with polygonal mesh Subdivide into larger number of polygons, smooth result after each subdivision Lots of ways to do this. The limit surface is smooth! 41

Corner Cutting Slide by Adi Levin 42

Corner Cutting 3 : 1 1 : 3 Slide by Adi Levin 43

Corner Cutting 44

Corner Cutting Slide by Adi Levin 45

Corner Cutting Slide by Adi Levin 46

Corner Cutting Slide by Adi Levin 47

Corner Cutting Slide by Adi Levin 48

Corner Cutting Slide by Adi Levin 49

Corner Cutting A control point The limit curve The control polygon Slide by Adi Levin 50

A control point It turns out corner cutting (Chaikin s Algorithm) produces a quadratic B- Spline curve! (Magic!) The limit curve The control polygon Slide by Adi Levin 51

Corner Cutting A control point It turns out corner cutting (Chaikin s Algorithm) produces a quadratic B- Spline curve! (Magic!) The limit curve (Well, not totally unexpected, remember de Casteljau) The control polygon Slide by Adi Levin 52

Subdivision Curves and Surfaces Idea: cut corners to smooth Add points and compute weighted average of neighbors Same for surfaces Special case for irregular vertices vertex with more or less than 6 neighbors in a triangle mesh Warren et al. 53

Assignment 2: Loop Subdivision (Named after Charles Loop) 2 9 3 1 6 5 4 8 54

Assignment 2: Loop Subdivision The input mesh 2 9 3 1 6 5 4 8 55

Assignment 2: Loop Subdivision First step: insert vertices in the middle of all edges 2 19 9 23 20 18 3 22 21 6 10 12 1 11 16 15 17 5 14 4 13 8 56

Assignment 2: Loop Subdivision Then compute positions for new vertices Weighted combinations of the connected old vertices Need adjacency information (details in handout) p 11 = 1 8 p 5 + 1 8 p 6+ 3 8 p 1 + 3 8 p 4 w=1/8 6 w=3/8 1 11 5 w=1/8 4 w=3/8 57

Assignment 2: Loop Subdivision Then compute new positions for all old vertices! Again weighted combinations of nearby old vertices Need to find all n connected vertices p 0 1 =(1 nb) p 1 + B(p 2 + p 9 + p 5 + p 4 + p 6 + p 3 ) w=b 2 9 w=b B = ( 3 8n, n > 3 3 16, n =3 w=b 3 w=b 6 1 5 w=b w=1-nb 4 w=b 58

Assignment 2: Loop Subdivision Finally, split all input triangles into four: 2 19 9 23 20 18 3 22 21 6 10 12 1 11 16 15 17 5 14 4 13 8 59

Assignment 2: Loop Subdivision This becomes the new base mesh for next round 60

Assignment 2: Loop Subdivision Pictures Input mesh 61

Assignment 2: Loop Subdivision 1st level of subdivision 62

Assignment 2: Loop Subdivision 2nd level of subdivision etc. 63

Flavors of Subdivision Surfaces Catmull-Clark Quads and triangles Generalizes bicubics to arbitrary topology! Loop, Butterfly Triangles Leif Kobbelt Doo-Sabin, sqrt(3), biquartic... and a whole host of others Used everywhere in movie and game modeling! See http://www.cs.nyu.edu/~dzorin/sig00course/ 64

Subdivision Curves and Surfaces Advantages Arbitrary topology Smooth at boundaries Level of detail, scalable Simple representation Numerical stability, well-behaved meshes Code simplicity Little disadvantage: Procedural definition Not parametric, not implicit Tricky at special vertices 65 Warren et al.

Subdivision + Displacement zbrushcentral 66

Subdivision + Displacement Final Model Epic Games Control Mesh 67

ZBrush Modeling Session http://www.youtube.com/watch? v=i8livwn8zmq 68

Questions? 69

The remainder is for extra credit in Assignment 2! 70

Specialized Procedural Definitions Surfaces of revolution Rotate given 2D profile curve Generalized cylinders Given 2D profile and 3D curve, sweep the profile along the 3D curve Assignment 1 extras 71

Surface of Revolution 2D curve q(u) provides one dimension Note: works also with 3D curve Rotation R(v) provides 2nd dimension v s(u,v) s(u,v)=r(v)q(u) where R is a matrix, q a vector, and s is a point on the surface 72

General Swept Surfaces Trace out surface by moving a profile curve along a trajectory. profile curve q(u) provides one dim trajectory c(u) provides the other Surface of revolution can be seen as a special case where trajectory is a circle s q c s(u,v)=m(c(v))q(u) where M is a matrix that depends on the trajectory c 73

General Swept Surfaces How do we get M? Translation is easy, given by c(v) What about orientation? Orientation options: Align profile curve with an axis. Better: Align profile curve with frame that follows the curve s q c s(u,v)=m(c(v))q(u) where M is a matrix that depends on the trajectory c 74

Normals for Swept Surfaces Need partial derivatives w.r.t. both u and v n =( P/ u) ( P/ v) Remember to normalize! One given by tangent of profile curve, the other by the trajectory s q c s(u,v)=m(c(v))q(u) where M is a matrix that depends on the trajectory c 75

Frames on Curves: Frenet Frame Frame defined by 1st (tangent), 2nd (curvature) and 3rd (torsion) derivatives of a 3D curve Looks like a good idea for swept surfaces... 76

Frenet: Problem at Inflection! Normal flips! Bad to define a smooth swept surface An inflection is a point where curvature changes sign 77

Smooth Frames on Curves Tangent is assumed reliable Build triplet of vectors include tangent orthonormal coherent over the curve Idea: use cross product to create orthogonal vectors exploit discretization of curve use previous frame to bootstrap orientation See Assignment 1 instructions! 78

Questions? 79

Implicit Surfaces Implicit definition: f(x,y,z)=0 e.g. for a sphere: x 2 +y 2 +z 2 =R 2 Often defined as metaballs with seed points f(x,y,z)=f1(x,y,z)+f2(x,y,z)+... where fi depends on distance to a seed point Pi P1 P2 From Blinn 1982 80

Implicit Surfaces Pros: Can handle weird topology for animation Easy to do sketchy modeling Some data comes this way (medical & scientific data) Cons: Does not allow us to easily generate a point on the surface 81

Implicit Surfaces Most common method to generate mesh from isosurface: Marching Cubes (see link for details) 82

Questions? 83

Point Set Surfaces Given only a noisy 3D point cloud (no connectivity), can you define a reasonable surface using only the points? Laser range scans only give you points, so this is potentially useful? 84

Point Set Surfaces Alexa et al. 2001 85

Point Set Surfaces Modern take on implicit surfaces Cool math: Moving Least Squares (MLS), partitions of unity, etc. Ohtake et al. 2003 Not required in this class, but nice to know. 86

Questions? 87

That s All for Today Further reading on subvision curves and surfaces http://www.cs.nyu.edu/~dzorin/sig00course/ Guilherme Marconi 88