Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics
- Spline and Subdivision Surfaces -
Computer Graphics - Spline and Subdivision Surfaces - Hendrik - - PowerPoint PPT Presentation
Computer Graphics - Spline and Subdivision Surfaces - Hendrik Lensch Computer Graphics WS07/08 Spline & Subdivision Surfaces Overview Last Time Image-Based Rendering Today Parametric Curves Lagrange Interpolation
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces 2
– Image-Based Rendering
– Parametric Curves – Lagrange Interpolation – Hermite Splines – Bezier Splines – DeCasteljau Algorithm – Parameterization
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Spline curve with local control and high continuity
– Degree: n – Control points: P0, ..., Pm (Control polygon, m ≥ n+1) – Knots: t0, ..., tm+n+1 (Knot vector, weakly monotonic) – The knot vector defines the parametric locations where segments join
– Continuity:
i m i n i
P t N t P
=
= ) ( ) (
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
) ( ) ( ) (
if 1 ) (
1 1 1 1 1 1 1
t N t t t t t N t t t t t N t t t t N
n i i n i n i n i i n i i n i i i i − + + + + + + − + +
− − − − − = ⎩ ⎨ ⎧ < < =
1 2 3 4 5 1 2 3 4 5 N0 N1 N2 N3 N4 N0
1
N1
1
N2
1
N3
1
Uniform Knot vector
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Degree increases in every step – Support increases by one knot interval
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– All knots at integer locations
– Example: cubic B-Splines
– Basis functions affect only (n+1) Spline segments – Changes are localized
n i n i
N B =
n i n i
d P =
Degree 2
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Spline segment lies in convex Hull of (n+1) control points – (n+1) control points lie on a straight line curve touches this line – n control points coincide curve interpolates this point and is tangential to the control polygon (e.g. beginning and end)
Degree 2
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Partition of unity: – Knots at beginning and end with multiplicity – Interpolation of end points and tangents there – Conversion to Bézier segments via knot insertion
1 ) ( =
i n i t
N
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Evaluation at t: tl < t < tl+1: i ∈ {l-n, ..., l}
– Affine invariance – Stable numerical evaluation
i i r i r i n i r i r i r i n i r i r i
− + + + + + − + + + +
1 1 1 1 1
n i n i
d t P = ) (
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Given a new knot t
– T*= T ∪ {t} – New representation of the same curve over T*
– Refinement of curve, display
Consecutive insertion of three knots at t=3 into a cubic B-Spline First and last knot have multiplicity n T=(0,0,0,0,1,2,4,5,6,6,6,6), l=5
+ − + =
1 * * 1 *
i n i i i i i i i i m i n i
i
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Remember:
– In more detail: If two consecutive knots have multiplicity n
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Homogeneous control points: now with weight wi
= = = = =
= = = =
m i i n i i n i n i m i i i n i m i i n i m i i i n i m i n i
w t N w t N t R w P t R w t N w P t N P P t N t P
i
´
) ( ) ( ) ( mit , ) ( ) ( ) ( ) ( ) ´(
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Piecewise rational functions – Weights
– Invariant under projective transformations – Variation-Diminishing-Property (in functional setting)
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– P: R2 → R3 – P(u,v) = (x(u,v), y(u,v), z(u,v))T∈ R3 (also P(R4))
– Triangular Splines
coordinates with respect to a reference triangle (e.g. B-Patches)
– Tensor Product Surfaces
– Subdivision Surfaces
– Depending on local neighborhood
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Create a “curve of curves"
– Two lines in space – Connected by lines – Bézier representation (symmetric in u and v) – Control mesh Pij
) ) 1 (( ) ) 1 )(( 1 ( ) ( ) ( ) 1 ( ) , (
11 01 10 00 2 1
P v P v u P v P v u v P u v P u v u P + − + + − − = + − =
P00 P01 P10 P11 u v
=
=
1 , 1 1
) ( ) ( ) , (
j i ij j i
P v B u B v u P
11 01 2 10 00 1
) 1 ( ) ( ) 1 ( ) ( P v P v v P P v P v v P + − = + − =
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Arbitrary basis functions in u and v
– Commonly same basis functions and same degree in u and v
– Curve defined by curves – Symmetric in u and v
= =
=
m i n j ij n j m i
P v B u B v u P ) ( ) ( ) , (
= =
=
m i v P n j ij j i
i
P v B u B v u P
) ( ´
´
) ( ) ( ) , ( 4 3 4 2 1
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Geometry now in a „tensor“ (m x n x 3) – Degree
m
n
m+n – Not nice → „Triangular Splines“
T T V UV n n n nn m T monom
V U v v G G G G u u V U v u P
U
B G B G
´ 00
1 1 ) , ( = ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ⎛ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ = = M L M O M L L
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Surface interpolates corner vertices of mesh – Vertices at edges of mesh define boundary curves – Convex hull property holds – Simple computation of derivatives – Direct neighbors of corners vertices define tangent plane
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– http://www.holmes3d.net/graphics/teapot/
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Once for u in each column – Once for v in the resulting row – Due to symmetry also in other order
– Subdivision – Extrapolation – Display – ...
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Tessellate into many triangles (using deCasteljau or deBoor)
– Recursive subdivision
– Bézier Clipping [Sederberg et al.]
Root finding Can eliminate parts of the surface where convex hull does not intersect ray
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Spline: R3 → R
– Spline: R3 → R3
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Represent 3D objects in a computer? – Construct such representations quickly and/or automatically with a computer? – Manipulate 3D objects with a computer?
– Computer Graphics – Computer-Aided Geometric Design – Visualization – Robotics, …
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Range image – Point cloud – Polygon soup
– Mesh – Subdivision – Parametric – Implicit
– Voxels – BSP tree – CSG
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Acquired from range scanner
– Structured point cloud
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Often constructed from many range images
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Point cloud – Range image – Polygon soup
– Mesh – Subdivision – Parametric – Implicit
– Voxels – BSP tree – CSG
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Careful constraints to maintain continuity
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Define smooth surface as limit of sequence of refinements
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Point cloud – Range image – Polygon soup
– Mesh – Subdivision – Parametric – Implicit
– Voxels – BSP tree – CSG
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Acquired from CAT, MRI, etc.
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Constructed from polygonal representations
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
applied to simple shapes
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Traditionally spline patches (NURBS) have been used in production for character animation.
– Maintaining continuity is hard
Subdivision in Character Animation Tony Derose, Michael Kass, Tien Troung (SIGGRAPH ’98) (Geri’s Game, Pixar 1998)
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Easy and commonly used in CAD systems – Most surfaces are not made of quadrilateral patches
– Trimming NURBS is expensive and
– Very difficult to stich together separate surfaces – Very hard to hide seams
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Applicable to meshes of arbitrary topology (non-manifold meshes). – No trimming needed – Scalability, level-of-detail. – Numerical stability. – Simple implementation. – Compact support. – Affine invariance. – Continuity – Still less tools in CAD systems (but improving quickly)
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Limit Surfaces/Curve will pass through original set of data points.
– Limit Surface will not necessarily pass through the original set of data points.
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
used for:
– Geri’s hands and head – Clothes: Jacket, Pants, Shirt – Tie and Shoes (Geri’s Game, Pixar 1998)
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Subdivide each face of the polyhedron
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– The basic concepts of subdivision.
– Important known methods. – Discussion: subdivision vs. parametric surfaces.
Based on slides Courtesy of Adi Levin, Tel-Aviv U.
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
A control point
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
The control polygon The limit curve A control point
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Non interpolatory subdivision schemes
Interpolatory subdivision schemes
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– A subdivision curve is generated by repeatedly applying a subdivision operator to a given polygon (called the control polygon).
– Convergence: Given a subdivision operator and a control polygon, does the subdivision process converge? – Smoothness: Does the subdivision process converge to a smooth curve?
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– In each iteration, the subdivision operator refines the control net, increasing the number of vertices (approximately) by a factor of 4.
– In the limit the vertices of the control net converge to a limit surface.
– Every subdivision method has a method to generate the topology of the refined net, and rules to calculate the location of the new vertices.
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Different methods for refining topology
– Interpolating versus approximating
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Every face is replaced by 4 new triangular faces. The are two kinds of new vertices:
Old vertices New vertices
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Every new vertex is a weighted average of the old vertices. The list
αn/n
A rule for new red vertices A rule for new green vertices
3 3 8 3 3 16
n
n n α ⎧ > ⎪ ⎪ = ⎨ ⎪ = ⎪ ⎩
⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + − =
2
2 cos 2 3 40 64 1 n
n
π α
αn/n αn/n αn/n αn/n 1-αn
Original Warren
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
2 1 2 1 8 1 8 1 8 6
Edge Rule Vertex Rule
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Smask is very sparse – Never Implement this way! – Allows for analysis
2 1 1 11 10 01 00
n nj mask
Smask Weights Old Control Points New Points
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
The limit surfaces of Loop’s subdivision have continuous curvature almost everywhere
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– After one iteration, all the faces are quadrilateral.
Every face is replaced by quadrilateral faces. The are three kinds of new vertices:
Yellow vertices are associated with old faces faces
Old vertices New vertices Old edge Old face
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
First, all the yellow vertices are calculated
Then the green vertices are calculated using the values of the yellow vertices
1 1 1 1 1 1 1 1 1
n
Finally, the red vertices are calculated using the values of the yellow vertices
) 2 ( − = n n wn
n - the vertex valence
1
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
The limit surfaces of Catmull-Clarks’s subdivision have continuous curvature almost everywhere
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Edges & creases – Can be marked in model
– Controllable sharpness – Sharpness (s) = 0, smooth – Sharpness (s) = inf, sharp – Achievable through hybrid subdivision step
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Curvature – Screen size
– View dependence
– Careful!
crack
subdiv
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Using polygonal methods can result in distortion
– Assign texture coordinates to each original vertex – Subdivide them just like geometric coordinates
– Used for texturing in Geri’s jacket, ears, nostrils
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Store offsets to vertices at different levels – Offsets performed in normal direction – Can change shape at different resolutions while rest stays the same
– Can perform filtering operations on meshes
– Can easily adjust maximum depth for rendering
Computer Graphics WS07/08 – Spline & Subdivision Surfaces
– Simple method for describing complex surfaces – Relatively easy to implement – Arbitrary topology – Local support – Guaranteed continuity – Multi-resolution
– Intuitive specification – Parameterization – Intersections