09 - Designing Surfaces CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Triangular Surfaces • A surface can be discretized by a collection of points and triangles • Each triangle is a subset of a plane • Every point on the surface can be expressed as an affine combination of three vertices • The surface is C 0 CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Barycentric Coordinates • The points inside a triangle, are usually parametrized using barycentric coordinates w : v 3 v 1x v 2x v 3x w 1 p x = v 1y v 2y v 3y w 2 p y p 1 1 1 w 3 1 v 2 v 1 • The barycentric coordinates naturally defines a parametrization CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Tensor Surfaces CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Bilinear Interpolation • Linear interpolation • “Simplest” curve between two points Isoparametric curve • Bilinear interpolation • “Simplest” surface between four points 1 1 X X b i,j B 1 i ( u ) B 1 x ( u, v ) = j ( v ) i =0 j =0 u � ✓ b 00 ◆ ✓ 1 − v ◆ b 01 � 1 − u Domain = b 10 b 11 v CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Bilinear Interpolation • Linear interpolation • “Simplest” curve between two points • Bilinear interpolation • “Simplest” surface between four points b 01 00 = (1 − v ) b 00 + vb 01 b 01 10 = (1 − v ) b 10 + vb 11 b 00 11 = (1 − u ) b 01 00 + ub 01 10 CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Bézier Patches • Build on Bézier curves b 20 b 21 b 10 m b 23 b 11 X b m ( u ) = b i B m i ( u ) i =0 b 33 • Control points as curves n b 13 X b ij B n b i = b i ( v ) = j ( v ) b 00 j =0 m n b 03 X X b mn ( u, v ) = b ij B m i ( u ) B n j ( v ) i =0 j =0 • Keep one parameter fixed: iso-parameter curves CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Properties • Affine invariance CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Properties • Affine invariance • Repeated (bi-)linear combinations • Convex hull property CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Properties • Affine invariance • Repeated (bi-)linear combinations • Convex hull property • Partition of unity and non-negativity • Polynomial boundary curves and corner interpolation CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Properties • Affine invariance • Repeated (bi-)linear combinations • Convex hull property • Partition of unity and non-negativity • Polynomial boundary curves and corner interpolation • Variation diminishing CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Properties • Affine invariance • Repeated (bi-)linear combinations • Convex hull property • Partition of unity and non-negativity • Polynomial boundary curves and corner interpolation • Variation diminishing CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
De Casteljau Algorithm • Bézier curves created by repeated linear interpolation • Surfaces: repeated bilinear interpolation CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Demo http://cagd-applets.webarchiv.kit.edu/mocca/html/noplugin/inhalt.html CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
NURBS Surfaces j w i,j d i,j N m i ( u ) N n � � j ( v ) i x ( u, v ) = j w i,j N m i ( u ) N n � � j ( v ) i • Standard in most advanced modeling systems projection of tensor product patches ≠ tensor product surface! (basis is not separable) CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
NURBS Surfaces • Standard in most advanced modeling systems CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
NURBS Surfaces • Influence of weights CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
NURBS Surfaces • Influence of weights CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
NURBS Surfaces • Influence of weights CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
NURBS Surfaces • Influence of weights CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Subdivision Surfaces CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Why? • Tensor product surfaces are defined on “regular grids” • They cannot be defined on arbitrary meshes CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
A different way of constructing curves! CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Interpolating: 4 point scheme CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Interpolating: 4 point scheme CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Interpolating: 4 point scheme CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Interpolating: 4 point scheme CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Catmull-Clark scheme odd even Converges to cubic B-spline CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Subdivision Methods • Principal characteristics: • triangular or quadrangular meshes • approximating or interpolating • smoothness of the limit surface • We will study 2 of them: • Loop subdivision for triangle meshes (Approximating, C 2 ) • Catmull-Clark subdivision for quadrilateral meshes (Approximating, C 2 ) • Other famous schemes (see the references for details) • Butterfly, Kobbelt, Doo-Sabin, Midedge, Biquartic CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Loop subdivision w ( n ) = 5 8 − (3 8 + 1 4 cos 2 π n ) 2 CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Special stencils • Special stencils exist that allow to evaluate: • The limit position of a vertex : that is, in a single step you can compute the position of one vertex after an infinite number of subdivisions • The tangent plane at a vertex : in this case, two stencils are used and each stencil generates a vector that lies in the tangent plane • It is also possible to evaluate the surface analytically, in other words it is possible to find the mapping between every point of the control mesh and the limit surface. For details see http://www.autodeskresearch.com/publications/loopsubdiv CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Catmull Clark subdivision 3 β = 2 N On a regular grid, the Catmull clark 1 subdivision is a collection of bicubic γ = 4 N Bézier patches CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Catmull-Clark • It is the standard in the animation industry • All the major 3D modeling softwares support it • Similarly to Loop: • stencils for the limit surface • stencils for tangent plane • it can be evaluated analytically CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
How are they used in practice? CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Efficient implementation • At every subdivision step, we add new vertices and move the existing ones in new positions • Every position is computed as a weighted average of existing vertices • This means that the process is linear! • For a fixed number of levels of subdivision, the vertices of subdivided surface can be computed as: Subdivided vertices p = Sq Control vertices • where S is a sparse and fixed matrix CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
T-spline • Extension of splines for non-rectangular grids • http://www.youtube.com/watch?v=k1ro9S-cAwI CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
References Fundamentals of Computer Graphics, Fourth Edition 4th Edition by Steve Marschner, Peter Shirley Chapter 15 Curves and Surfaces for CAGD - Gerald Farin Subdivision Zoo - Denis Zorin http://www.cmlab.csie.ntu.edu.tw/~robin/courses/gm/note/subdivision-prn.pdf CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Projective Transformations CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Viewing Transformation camera space screen space object space model camera projection viewport canonical world space view volume CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Orthographic Projection camera space y (r,t,f) (l,b,n) z x projection − r + l 2 0 0 r − l r − l − t + b 2 0 0 t − b t − b M orth = − n + f 2 0 0 n − f n − f 0 0 0 1 canonical view volume CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Perspective Projection • In Orthographic projection, the size of the objects does not change with distance • In Perspective projection, the objects that are far away look smaller Image Plane Image Plane y y s d y s = dy z z CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Divisions in Matrix Form • We would like to reuse the matrix machinery that we built in the previous lectures y s = dy Image Plane • How do we encode divisions? z • We extend homogeneous coordinates y y s d z CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Recommend
More recommend