surfaces
DESCRIPTION
Surfaces. Lecture 6 (Modelling). Reminder: Homogenous Co-ordinates. 2D Translations cannot be encoded using matrix multiplication because points at the origin never move. Instead use homogenous co- ordinates - PowerPoint PPT PresentationTRANSCRIPT
SurfacesSurfaces
Lecture 6 (Modelling)
Reminder: Homogenous Co-ordinatesReminder: Homogenous Co-ordinates
2D Translations cannot be encoded using matrix multiplication because points at the origin never move.
Instead use homogenous co- ordinates
These are projections of 3D points along a ray from the origin onto the plane .
0
0
0 0
0 0
0
0
d c
b a
d c
b a
2 2
) 0, 0(
) , ( ) , , (w
y
w
xw y x
1 w
Homogenous ProjectionsHomogenous Projections
An infinite number of homogenous co-ordinates map to every 2D point. are all equivalent to .
Points at infinity have and cannot be projected onto the plane because this would involve division by zero.
Conversion:
All of the above also applies to 3D homogenous co-ordinates:
) , 1, ( ) 2, 4, 2( )1, 2, 1(2
1
2
1
) 2, 1(0 w
1 w
) , ( )1, , (y x y x
) , , ( ) , , , (w
z
w
y
w
xwz y x
Matrices for Homogenous Matrices for Homogenous Co-ordinatesCo-ordinates
where is a standard transformation.
Translation:
1 0 0
0
0
d c
b a
T
d c
b a2 2
1 ' ' '
1 1 0 0
1 0
0 1
1
'
'
z t y y t x x
y
x
t
t
y
x
y x
y
x
Rational CurvesRational Curves
The control points of a Bézier or B-spline curve can be encoded in homogenous co-ordinates:
Rational curves have the form:
NURBS (Non-Uniform Rational B-spline) curves are the homogenous version of standard B-spline curves.
) , , , (i i i i iw z y x P
1
0
1
0
) (
) (
) (L n
ii
ni
L n
ii i
ni
w t N
P w t N
t Q
Behaviour of Rational CurvesBehaviour of Rational Curves
The fourth co-ordinate provides additional control and acts as a weighting term.If then behaves as normal
then attracts the curve then repulses the curve
is disallowed because it contravenes the convex hull property.
Strictly speaking, the behaviour of weighted control points is relative, rather than absolute. If all are set at then this enforces the same behaviour as all .
Rational curves have two advantages:1. They provide further control over the shape of the curve.
2. They can exactly represent conic sections (e.g. a circle).
BUT they are more computationally costly.
i w
i w 8. 01 i w
1 0 i w1 i w
0 i w
1 i w i Pi Pi P
Exercise: Knot Vectors and B-splinesExercise: Knot Vectors and B-splines
1. Determine the number of curve segments, number of spans ( ), curve domain, and continuity at the knots for the B-spline curves with the following knot vectors:(a)
(b)
2. Given the control points below (corresponding to these knot vectors) establish convex hulls and draw a rough sketch of the curves in each case:(a) (b)
}4, 3, 2, 2, 2, 1, 0{ , 2 T n}2, 2, 2, 1, 0, 0, 0{ , 3 T n
L
Solution I: Knot Vectors and B-splinesSolution I: Knot Vectors and B-splines
1. (a) curve segments and .
At knot the multiplicity is and continuity is . This is a discontinuity in position (a jump). (b) curve segments and .
The curve interpolates and . At knot the multiplicity is and continuity is .
2. (a) (b)
2 ] 2, 1[ ] 3, 2[
2 k 3 2 m1 3 2 2
C C Cm n
4 6 2 4 6 2 2 } ,..., {2 2 0 L L n L t t Tn L
2 ]1, 0[ ] 2, 1[2 6 2 6 6 2 2 } ,..., {2 2 0 L L n L t t Tn L
0P 4P 1 k1 1 m
2 1C C
m n
SurfacesSurfaces
Curves generalise to Surfaces: A surface is a function of two variables rather than just
one .
A rectangular surface has a curve running along each of its four edges.
A rectangular surface can be envisioned as a curve which changes its shape as it is swept through space. Each control point of the initial curve is moved along a path which is itself a curve.
Surface Definition: An -degree by -degree Bézier patch is defined by
control points :) , (v u S
) (t Q
n n )1 ( )1 ( n nn j n i Pj i,..., 0 ; ,..., 0 ,
n
i
n
jj i
nj
niP v B u B v u S
00, ) ( ) ( ) , (
Surface PropertiesSurface Properties
Adjacent control points can be connected to form a control net (which serves the same purpose as a control polygon).
The degrees along and do not have to match.
B-spline surfaces are a similar extension of B-spline curves.
Continuity between patches: C0: continuous in position. The four edge c.p. must match.
C1: continuous in position and tangent vector. The two control points on either side of each edge c.p. must be colinear with the edge point and each other and be equidistant from the edge point.
Algorithms (e.g. de Casteljau subdivision) and properties (e.g. convex hull) still apply with some small modification.
u v
Example SurfaceExample Surface
Example: cubic Bézier patch The four corner c.p. are interpolated.
Each edge is a curve defined by four c.p.
There are four interior c.p. determining the inner shape.
16 4 4 c.p. num 3 n
Rendering BRendering Béézier Surfaceszier Surfaces Adaptive Subdivision: Use a collection of planar polygons to
approximate the surface.
1. Check if a quadrilateral with corners at the endpoints is an adequate approximation to the surface.
2. If so, halt recursion.
3. If not, subdivide into two smaller Bézier patches using bi-parametric de Casteljau. Subdivision must alternate in and on successive recursive subdivisions.
4. Need to specify a tolerance for when the quadrilateral is an adequate approximation.
5. The set of resulting (non-planar) quadrilaterals is further subdivided into (planar) triangles.
A B-Spline surface can be converted to a set of Bézier patches by a process of knot insertion and then rendered.
u v
Subdivision SurfacesSubdivision Surfaces
Motivation: Creating objects from Bézier or B-spline patches is very difficult if
they have a non-planar topology. For instance a C1 sphere cannot be constructed from non-degenerate patches.
Complex topologies with many-sided patches are possible if a subdivision approach is adopted.
Method: Similar to Chaikin’s corner cutting. Start with a closed control net (which roughly approximates the
shape of the object). Successively refine the control net by introducing new control
points. In the limit this produces a smooth surface.
Proviso: The surface may have exception points where it is not as smooth.
Doo-Sabin SubdivisionDoo-Sabin Subdivision
Mostly produces a quadratic B-spline surface. Algorithm:
Input: an arbitrary open or closed polyhedron.
Output: a smooth surface.
Refinement:(1) Find the centroid of each face (average its vertices).
(2) Find the midpoints of all straight lines connecting the centroid to its defining vertices.
(3) Construct a new polyhedron from these midpoints by forming:
(a) E-faces. For a given edge there are four midpoints controlled by its endpoints. Connect these midpoints into a rectangle.
(b) V-faces. Form a face with the midpoints that surround an original vertex.
(c) F-faces. Connect the midpoints belonging to the same face.
Geri’s Game: Subdivision SurfacesGeri’s Game: Subdivision Surfaces
Subdivision Surface Technology:1. Sharp creases created by delaying
subdivision of an edge (wrinkles).
2. Clothing simulation by efficient collision detection between subdivision surfaces (jacket).
3. Constructing smooth scalar fields on subdivision surfaces for shading and texturing (skin).
Source:De Rose, T., Kass, M. and Teoung, T. “Subdivision Surfaces in
Character Animation”, SIGGRAPH ’98, pp. 85-94.
Bézier Triangles: Barycentric Co-ordsBézier Triangles: Barycentric Co-ords
The location of a point within a triangle can be expressed in barycentric co-ordinates.
Even though there are three parameters this is still a surface because they are not independent. Depends on and .
0 , , , 1) , , (3 2 1
w v u w v uP w P v P u w v u p
w v u, ,
w uvv u w 1
Bézier Triangles: NotationBézier Triangles: Notation
A degree Bézier triangle has control points.
Each control point is labelled by three values with the condition that .
Corner CP have or or and the other indices .
A point on the Bézier triangle at Barycentric co-ordinates has the Bernstein form:
n ) 2 ( )1 ( 2
1 n n
ijk in k j i i
n i n j n k0
) , , (w v u T) , , (w v u
k j ik j i
n n
n
n
w v u w v u B
P w v u B w v u T
! ! !
!
:
) , , (
) , , ( ) , , (
i
ii i
i
Bézier Triangles: Control PointsBézier Triangles: Control Points
Linear:
Quadratic:
Cubic:
1 n3 3 2 cp num2
1
2 n
6 4 3 cp num2
1
10 5 4 cp num2
1
3 n
Bézier Triangles: de Casteljau Bézier Triangles: de Casteljau AlgorithmAlgorithm
Abbreviations:
Algorithm: Given a triangular array of CP and barycentric co-
ordinates :
where and and is the point at on the Bézier triangle.
001 3 , 010 2 , 100 1 e e e) , , ( ,w v u ijk u i
i P) , , (w v u u
) ( ) ( ) ( ) (13
12
11u u u ui i i i
re
re
re
rP w P v P u P
r n n r i ; ,..., 1i iuP P) (
0) ( ) (u u iT P
n u
Bézier Triangle: Quadratic ExampleBézier Triangle: Quadratic Example
: ) , , (3
1
3
1
3
1 0P
: ) , , (3
1
3
1
3
1 1P
: ) , , (3
1
3
1
3
1 2P