Parametric & Implicit Surfaces
Total Page:16
File Type:pdf, Size:1020Kb
3D Object Representations • Points • Solids o Range image o Voxels o Point cloud o BSP tree Parametric & Implicit o CSG Sweep Surfaces • Surfaces o o Polygonal mesh Thomas Funkhouser o Subdivision • High-level structures Princeton University o Parametric o Scene graph Implicit Application specific COS 426, Spring 2007 o o Surfaces Parametric Surfaces • What makes a good surface representation? • Boundary defined by parametric functions: o Accurate o x = fx(u,v) o Concise o y = fy(u,v) o Intuitive specification o z = fz(u,v) y o Local support o Affine invariant Parametric functions v define mapping from o Arbitrary topology (u,v) to (x,y,z): v o Guaranteed continuity o Natural parameterization x o Efficient display u Efficient intersections u o z H&B Figure 10.46 FvDFH Figure 11.42 Parametric Surfaces Parametric Surfaces • Boundary defined by parametric functions: • Example: surface of revolution o x = fx(u,v) o Take a curve and rotate it about an axis o y = fy(u,v) o z = fz(u,v) • Example: ellipsoid x = r cos φ cos θ = x φ θ y ry cos sin = φ z rz sin H&B Figure 10.10 Demetri Terzopoulos 1 Parametric Surfaces Parametric Surfaces • Example: swept surface • How do we describe arbitrary smooth surfaces o Sweep one curve along path of another curve with parametric functions? Demetri Terzopoulos H&B Figure 10.46 Piecewise Polynomial Parametric Surfaces Parametric Patches • Surface is partitioned into parametric patches: • Each patch is defined by blending control points Same ideas as parametric splines! Same ideas as parametric curves! Watt Figure 6.25 FvDFH Figure 11.44 Parametric Patches Parametric Patches • Point Q(u,v) on the patch is the tensor product of • Point Q(u,v) on the patch is the tensor product of parametric curves defined by the control points parametric curves defined by the control points Q(u,v)? Q(0,1) Q(0,1) Q(1,1) Q(1,1) Q(0,0) Q(0,0) Q(1,0) Q(1,0) Watt Figure 6.21 Watt Figure 6.21 2 Parametric Patches Parametric Patches • Point Q(u,v) on the patch is the tensor product of • Point Q(u,v) on the patch is the tensor product of parametric curves defined by the control points parametric curves defined by the control points Q(0,1) Q(0,1) Q(1,1) Q(1,1) u=0.4 u=0.4 u=0.4 u=0.4 Q(0,0) Q(0,0) Q(1,0) Q(1,0) Watt Figure 6.21 Watt Figure 6.21 Parametric Patches Parametric Bicubic Patches • Point Q(u,v) on the patch is the tensor product of Point Q(u,v) on any patch is defined by combining parametric curves defined by the control points control points with polynomial blending functions: Q(u,v) P P P P Q(0,1) 1,1 2,1 3,1 4,1 P P P P Q(1,1) Q(u,v) = UM 1,2 2,2 3,2 4,2 M TVT P 1,3 P 2,3 P 3,3 P 4,3 u=0.4 v=0.5 P 1,4 P 2,4 P 3,4 P 4,4 u=0.4 Q(0,0) U = [u 3 u 2 u 1] V = [v3 v2 v 1] Q(1,0) Where M is a matrix describing the blending functions for a parametric cubic curve (e.g., Bezier, B-spline, etc.) Watt Figure 6.21 B-Spline Patches Bezier Patches P P P P 1,1 2,1 3,1 4,1 P 1,1 P 2,1 P 3,1 P 4,1 P P P P = 1,2 2,2 3,2 4,2 T P 1,2 P 2,2 P 3,2 P 4,2 T Q(u,v) UM − M − V = B Spline P P P P B Spline Q(u,v) UM Bezier M Bezier V 1,3 2,3 3,3 4,3 P 1,3 P 2,3 P 3,3 P 4,3 P P P P 1,4 2,4 3,4 4,4 P 1,4 P 2,4 P 3,4 P 4,4 −1 1 −1 1 6 2 2 6 −1 3 − 3 1 1 −1 1 0 = 2 2 3 − 6 3 0 M B−Spline M = −1 0 1 0 Bezier − 2 2 3 3 0 0 1 2 1 1 0 0 0 6 3 6 0 Watt Figure 6.28 FvDFH Figure 11.42 3 Bezier Patches Bezier Surfaces • Properties: • Continuity constraints are similar to the ones for o Interpolates four corner points Bezier splines o Convex hull o Local control Watt Figure 6.22 FvDFH Figure 11.43 Bezier Surfaces Bezier Surfaces •C0 continuity requires aligning boundary curves •C1 continuity requires aligning boundary curves and derivatives Watt Figure 6.26a Watt Figure 6.26b B-Spline Patches Parametric Surfaces • Advantages: P 1,1 P 2,1 P 3,1 P 4,1 P P P P o Easy to enumerate points on surface Q(u,v) = UM 1,2 2,2 3,2 4,2 MT V B−Spline B−Spline Possible to describe complex shapes P 1,3 P 2,3 P 3,3 P 4,3 o P P P P 1,4 2,4 3,4 4,4 • Disadvantages: o Control mesh must be quadrilaterals o Continuity constraints difficult to maintain −1 1 −1 1 6 2 2 6 o Hard to find intersections 1 −1 1 0 2 2 M − = B Spline −1 0 1 0 2 2 1 2 1 6 3 6 0 Watt Figure 6.28 4 3D Object Representations Implicit Surfaces • Points • Solids • Represent surface with function o Range image o Voxels over all space o Point cloud o BSP tree o CSG Sweep • Surfaces o o Polygonal mesh o Subdivision • High-level structures o Parametric o Scene graph o Implicit o Application specific Kazhdan Implicit Surfaces Implicit Surfaces • Surface defined implicitly by function • Surface defined implicitly by function: o f (x, y, z) = 0 (on surface) o f (x, y, z) < 0 (inside) o f (x, y, z) > 0 (outside) f(x,y) = 0 on curve f(x,y) < 0 inside f(x,y) > 0 outside Kazhdan Turk Implicit Surfaces Implicit Surface Properties • Normals defined by partial derivatives (1) Efficient check for whether point is inside o normal(x, y, z) = (df/dx, df/dy, df/dz) o Evaluate f(x,y,z) to see if point is inside/outside/on 2 2 2 x + y + z − = 1 0 rx ry rz Normals Tangents Curvatures Bloomenthal H&B Figure 10.10 5 Implicit Surface Properties Implicit Surface Properties (2) Efficient surface intersections (3) Efficient boolean operations (CSG) o Substitute to find intersections o Union, difference, intersect Ray: P = P 0 + tV Sphere: |P - O| 2 - r 2 = 0 Substituting for P, we get: 2 2 |P 0 + tV - O| - r = 0 P’ P V Solve quadratic equation: r 2 at + bt + c = 0 O where: P0 a = 1 Union Difference b = 2 V • (P 0 - O) c = |P - C| 2 - r 2 = 0 0 Bloomenthal Implicit Surface Properties Implicit Surface Properties (4) Efficient topology changes (4) Efficient topology changes o Surface is not represented explicitly! o Surface is not represented explicitly! Bourke Bloomenthal Comparison to Parametric Surfaces Implicit Surface Representations • Implicit • How do we define implicit function? o Efficient intersections & topology changes o Algebraics Blobby models • Parametric o o Skeletons o Efficient “marching” along surface & rendering o Procedural o Samples o Variational Bloomenthal 6 Implicit Surface Representations Algebraic Surfaces • How do we define implicit function? • Implicit function is polynomial Algebraics o f(x,y,z)=ax d+by d+cz d+dx d-1y+dx d-1z +dy d-1x+... o Blobby models Skeletons o 2 2 2 o Procedural x + y + z − = 1 0 o Samples rx ry rz o Variational H&B Figure 10.10 Algebraic Surfaces Algebraic Surfaces • Most common form: quadrics • Higher degree algebraics o f(x,y,z)=ax 2+by 2+cz 2+2dxy+2eyz+2fxz+2gx+2hy+2jz+k • Examples o Sphere o Ellipsoid o Torus o Paraboloid Cubic Quartic Degree six o Hyperboloid Menon Algebraic Surfaces Algebraic Surfaces • Function extends to infinity • Equivalent parametric surface o Must trim to get desired patch (this is difficult!) o Tensor product patch of degree m and n curves yields algebraic function with degree 2mn Bicubic patch has degree 18! 7 Algebraic Surfaces Implicit Surface Representations • Intersection • How do we define implicit function? o Intersection of degree m and n algebraic surfaces o Algebraics yields curve with degree mn Blobby models o Skeletons o Procedural o Samples o Variational Intersection of bicubic patches has degree 324! Blobby Models Blobby Models • Implicit function is sum of spherical basis functions • Sum of two blobs Turk Blobby Models Blobby Models • Sum of four blobs • Blobby molecules 2 D(r) = ae −br • Meta balls 2 − 3r ≤ ≤ a 1( 2 ) 0 r b 3/ b 3a r D(r) = 1( − )2 b 3/ ≤ r ≤ b 2 b 0 b ≤ r • Soft objects 6 4 2 4r 17 r 22 r = a 1( − + − r ≤ b D(r) 9b 6 9b 4 9b 2 Turk 0 r ≥ b Bourke 8 Blobby Model of Face Blobby Model of Face Blobby Model of Face Blobby Model of Head Blobby Model of Head Blobby Model of Head 9 Blobby Models Implicit Surface Representations Objects resulting from CSG of • How do we define implicit function? implicit soft objects and other primitives o Algebraics o Blobby models Skeletons o Procedural o Samples o Variational Menon Skeletons Skeletons • Bulge problem • Bulge problem → → Skeletons Implicit Surface Representations • Convolution surfaces • How do we define implicit function? o Algebraics o Blobby models o Skeletons Procedural o Samples o Variational Bloomenthal 10 Procedural Implicits Implicit Surface Representations • f(x,y,z) is result of procedure • How do we define implicit function? o Example: Mandelbrot set o Algebraics o Blobby models o Skeletons o Procedural Samples o Variational H&B Figure 10.100 Sampled Functions Sampled Functions • Most common example: voxels • Acquired from simulations or scans o Interpolate samples stored on regular grid o Isosurface at f(x,y,z) =0 defines surface 2.3 1.7 0.9 0.2 1.2 0.4 0.1 -0.8 0.3 -0.5 -0.7 -1.4 Airflow Inside a Thunderstorm Visible Human (Bob Wilhelmson, (National Library of Medicine) 0.2 -0.9 -1.7 -2.5 University of Illinois at Urbana-Champaign) Implicit Surface Representations Variational Implicit Surfaces • How do we define implicit function? o Algebraics - - o Blobby models - - o Skeletons - o Procedural - o Samples Variational - - - - - - Turk 11 Example Implicit Surface Implicit Surface Summary • Advantages: o Easy to test if point is on surface o Easy to compute intersections/unions/differences o Easy to handle topological changes • Disadvantages: o Indirect specification of surface o Hard to describe sharp features o Hard to enumerate points on surface » Slow rendering Turk Summary Feature Polygonal Mesh Subdivision Surface Implicit Surface Parametric Surface Accurate No Yes Yes Yes Concise No Yes Yes Yes Intuitive specification No No Yes No Local support Yes No Yes Yes Affine invariant Yes Yes Yes Yes Arbitrary topology Yes No No Yes Guaranteed continuity No Yes Yes Yes Natural parameterization No No Yes No Efficient display Yes No Yes Yes Efficient intersections No Yes No No 12.