Curved Surfaces - Computer Graphics Laboratory at UCSD

advertisement
#8: Curves and
Curved Surfaces
CSE167: Computer Graphics
Instructor: Ronen Barzel
UCSD, Winter 2006
Outline for today



Summary of Bézier curves
Piecewise-cubic curves, B-splines
Surface Patches
1
Curves: Summary


Use a few control points to describe a curve in space
Construct a function x(t)



moves a point from start to end of curve as t goes from 0 to 1
tangent to the curve is given by derivative x’(t)
We looked at:


p1
Linear -- trivial case, just to get oriented
Bézier curves -- in particular, cubic
p1
p0
Linear
p1
p3
p2
p0
p2
p0
Quadratic
Cubic
2
Linear Interpolation: Summary

Given two points p0 and p1

“Curve” is line segment between them
p0
.
0<t<1
p1
.
t=1
t=0
 Three ways of writing expression:
x(t)  (1  t)p 0  (t)p1
Weighted average of the control points
x(t)  (p1  p 0 )t  p 0
Polynomial in t
x(t)  p 0
 1 1   t 
p1 
 
 1 0  1
Matrix form
3
Cubic Bézier Curve: Summary

Given four points p0, p1, p2, p3



curve interpolates the endpoints
intermediate points adjust shape: “tangent handles”
Recursive geometric construction

•
de Casteljau algorithm
p0

p1
x
p2
Three ways to express curve



Weighted average of the control points: Bernstein polynomials
Polynomial in t
Matrix form
p3
4
Cubic Bézier: Bernstein Polynomials
x(t)  B0 t p 0  B1 t p1  B2 t p 2  B3 t p 3
The cubic Bernstein polynomials :
B0 t   t 3  3t 2  3t  1
B1 t   3t 3  6t 2  3t
B2 t   3t 3  3t 2
B3 t   t 3
B0 (t QuickTime™
) B1 (t ) B
2 (ta)
and
B3 (t )
TIFF (Uncompressed) decompressor
are needed to see this picture.
 B (t)  1
i

Notice:


Weights always add to 1
B0 and B3 go to 1 -- interpolating the endpoints
5
Cubic Bézier: Polynomial, Matrix, Notation
 Polynomial in t :
a  p 0  3p1  3p 2  p 3 
x(t)  at 3  bt 2  ct  d
b  3p 0  6p1  3p 2 
c  3p 0  3p1 
d  p 0 
 Matrix form:
x(t)  p 0
p1
p2
G Bez
 1 3 3 1   t 3 
 3 6 3 0  t 2 
 
p 3 
 3 3 0 0   t 

 
 1 0 0 0  1 
B Bez
T
 (New) Notation:
Bez(t, p 0 , p1 , p 2 , p 3 )  x(t) for the given control points
6
Tangent to Cubic Bézier
 Polynomial in t :
a  p 0  3p1  3p 2  p 3 
x(t)  3at  2bt  c
2
b  3p 0  6p1  3p 2 
c  3p 0  3p1 
d  p 0 
 d not used in tangent
 Matrix form:
x(t)  p 0
p1
p2
G Bez
 1 3 3 1   3t 2 
 3 6 3 0   2t 
 
p 3 
 3 3 0 0   1 

 
 1 0 0 0  0 
B Bez
T
 Notation:
Bez(t, p 0 , p1 , p 2 , p 3 )  x(t) for the given control points
7
nth-order Bézier curve
n
x t    Bin t p i
i0
 n
ni
Bin t     1  t  t 
 i
B01 t   t  1
B11 t   t
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
B02 t   t 2  2t  1
B12 t   2t 2  2t
B22 t   t 2
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
B03 t   t 3  3t 2  3t  1
B13 t   3t 3  6t 2  3t
B23 t   3t 3  3t 2
B33 t   t 3
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
8
Evaluate/draw curves by:

Sampling uniformly in t
x(t)
x(1.0)
x(0.5)
x(0.25)
x(0.75)
x(0.0)

Adaptive/Recursive Subdivision
x(t)
9
Outline for today



Summary of Bézier curves
Piecewise-cubic curves, B-splines
Surface Patches
10
More control points

Cubic Bézier curve limited to 4 control points



Cubic curve can only have one inflection
Need more control points for more complex curves
With k points, could define a k-1 order Bézier
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.



QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
But it’s hard to control and hard to work with
The intermediate points don’t have obvious effect on shape
Changing any control point can change the whole curve
• Want local support: each control point only influences nearby portion of curve
11
Piecewise Curves

With a large number of points…


Construct a curve that is a sequence of simple (low-order) curves end-to-end
Known as a piecewise polynomial curve

E.g., a sequence of line segments: a piecewise linear curve

E.g., a sequence of cubic curve segments: a piecewise cubic curve

In this case, piecewise Bézier
12
Continuity

For the whole curve to look smooth, we need to consider continuity:



C0 continuity: no gaps. The segments must match at the endpoints
C1 continuity: no corners. The tangents must match at the endpoints
C2 continuity: tangents vary smoothly. (makes smoother curves.)
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.

QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Note also: G1, G2, etc. continuity
•
•
•
•
Looks at geometric continuity without considering parametric continuity
Roughly, means that the tangent directions must match, but not the magnitudes
Gets around “bad” parametrizations
Often it’s what we really want, but it’s harder to compute
13
Constructing a single curve from many

Given N curve segments: x0(t), x1(t), …, xN-1(t)


Each is parameterized for t from 0 to 1
Define a new curve, with u from 0 to N:
x 0 (u),
x (u  1),
 1
x(u)  

x N 1 (u  N  1),
0  u 1
1 u  2
N 1 u  N
x(u)  x i (u  i), where i  u 

(and x(N )  x N 1 (1))
Alternate: u also goes from 0 to 1
x(u)  xi (Nu  i), where i   Nu 
14
Piecewise-Linear curve


Given N+1 points p0, p1, …, pN
Define curve:
x(u)  Lerp(u  i, pi ,p i 1 ),
i  u  i 1
 (1  u  i)p i  (u  i)p i1 , i  u 
p1
p0





x(2.9)
x(1.5)
p3
p2
p4
p5
x(5.25)
p6
N+1 points define N linear segments
x(i)=pi
C0 continuous by construction
G1 at pi when pi-1, pi, pi+1 are collinear
C1 at pi when pi-pi-1 = pi+1-pi
15
Piecewise Bézier curve: segments
 Given 3N  1 points p 0 , p1 , , p 3N
 Define N Bézier segments:
x 0 (t)  B0 (t)p 0  B1 (t)p1  B2 (t)p 2  B3 (t)p 3
x1 (t)  B0 (t)p 3  B1 (t)p 4  B2 (t)p 5  B3 (t)p 6
x N 1 (t)  B0 (t)p 3N  3  B1 (t)p 3N  2  B2 (t)p 3N 1  B3 (t)p 3N
p7
p6
p2
p1
x0(t)
p8
x2(t)
p9
x3(t)
p3
p0
p10
x1(t)
p4
p11
p12
p5
16
Piecewise Bézier curve
0u3
x 0 ( 13 u),
 1
3u 6
x1 ( u  1),
x(u)   3

x N 1 ( 13 u  (N  1)), 3N  3  u  3N
x(u)  x i 13 u  i , where i   13 u 
x(8.75)
x2(t)
x3(t)
x0(t)
x1(t)
x(3.5)
17
Piecewise Bézier curve






3N+1 points define N Bézier segments
x(i)=p3i
C0 continuous by construction
G1 continuous at p3i when p3i-1, p3i, p3i+1 are collinear
C1 continuous at p3i when p3i-p3i-1 = p3i+1-p3i
C2 is harder to get
p4
p2
p2
p6
p1
p1
p4
P3
p5
p0
C1
discontinuous
p6
P3
p0
p5
C1 continuous
18
Piecewise Bézier curves


Used often in 2D drawing programs
Inconveniences:


Must have 4 or 7 or 10 or 13 or … (1 plus a multiple of 3) points
Not all points are the same
• UI inconvenience: Interpolate, approximate, approximate, interpolate, …
• Math inconvenience: Different weight functions for each point

UI solution: “Bézier Handles”

Math solution: B-spline
19
UI for Bézier Curve Handles

Bézier segment points:



Interpolating points presented normally as curve control points
Approximating points presented as “handles” on the curve points
UI features:


All curve control points are the same
Can have option to enforce C1 continuity
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
(www.blender.org)
20
Blending Functions
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.

Evaluate using “Sliding window”




Local support: Window spans 4 points
Window contains 4 different Bernstein polynomials
Window moves forward by 3 units when u passes to next Bézier segment
Evaluate matrix in window:
x(u)  t 3 t 2
T
 1
3
t 1 
 3

1
3 3 1   p 3i 
6 3 0   p 3i 1 

 where t  1 u  i and i   1 u 
3 
3
3 0 0   p 3i  2 


0 0 0   p 3i  3 
B Bez
GBez
21
B-spline blending functions
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.

Still a sliding “window”, but use same weight function for every point



QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Weight function goes to 0 outside the 4-point neighborhood
local support -- each spot on curve only affected by neighbors
Shift “window” by 1, not by 3

No discrete segments: every point is the same
x(u)  t 3
 1 3 3

1  3 6 3
2
t t 1
6  3 0 3

1 4 1
B B spline
T
1
0

0

0
 pi 
p 
 i 1  where t  u  i and i  u 
pi  2 


 pi  3 
GB spline
22
B-Spline

Widely used for surface modeling




Doesn’t interpolate endpoints



Intuitive behavior
Local support: curve only affected by nearby control points
Techniques for inserting new points, joining curves, etc.
Not a problem for closed curves
Sometimes use Bézier blending at the ends
But wait, there’s more!


Rational B-Splines
Non-uniform Rational B-Splines
23
Rational Curves

Big drawback of all cubic curves: can’t make circles!


Nor ellipses, nor arcs. I.e. can’t make conic sections
Rational B-spline: Add a weight to each point



Homogeneous point: use w
Weight causes point to “pull” more (or less)
With proper points & weights, can do circles
pull more
pull less

Rational B-splines widely used for surface modeling


Need UI to adjust the weight
Often hand-drawn curves are unweighted, but automatically-generated
curves for circles etc. have weights
24
Non-Uniform Rational B-Spline (NURBS)

Don’t assume that control points are equidistant in u


Features…





Allows tighter bends or corners
Allows corners (C1 discontinuity)
Certain knot values turn out to give a Bézier segment
Allows mixing interpolating (e.g. at endpoints) and approximating
Math is messier


Introduce knot vector that describes the separation of the points
Read about it in Buss
Very widely used for surface modeling


Can interactively create as if uniform
Techniques for cutting, inserting, merging, filleting, revolving, etc…
25
Outline for today



Summary of Bézier curves
Piecewise-cubic curves, B-splines
Surface Patches
26
Curved Surfaces

Remember the overview of curves:




Described by a series of control points
A function x(t)
Segments joined together to form a longer curve
Same for surfaces, but now two dimensions



Described by a mesh of control points
A function x(u,v)
Patches joined together to form a bigger surface
27
Parametric Surface Patch

x(u,v) describes a point in space for any given (u,v) pair


u,v each range from 0 to 1
Rectangular topology
v
x(0.8,0.7)
x(0.4,v)
z
u
y
x(u,0.25)
x
1

Parametric curves:



For fixed u0 , have a v curve x(u0,v)
For fixed v0 , have a u curve x(u,t0)
For any point on the surface, there are a pair
of parametric curves that go through point
v
0
u
1
28
Parametric Surface Tangents


The tangent to a parametric curve is also tangent to the surface
For any point on the surface, there are a pair of (parametric) tangent vectors

Note: not necessarily perpendicular to each other
x
v
v
u
x
u
 Notation:
 The tangent along a u curve, AKA the tangent in the u direction, is written as:
x
(u, v) or u x(u, v) or x u (u, v)
u
 The tangent along a v curve, AKA the tangent in the v direction, is written as:
x
(u, v) or
v

v
x(u, v) or x v (u, v)
 Note that each of these is a vector-valued function:
 At each point x(u, v) on the surface, we have tangent vectors u x(u, v) and

v
x(u, v)
29
Parametric Surface Normal

Get the normal to a surface at any point by taking the cross product of the
two parametric tangent vectors at that point.

Order matters!
n
x
v
x
u
n(u, v) 
x
x
(u, v)  (u, v)
u
v
Typically we are interested in the unit normal, so we need to normalize
x
x
(u, v)  (u, v)
u
v
n* (u, v)
n(u, v)  *
n (u, v)
n* (u, v) 
30
Polynomial Surface Patches

x(s,t) is typically polynomial in both s and t

Bilinear:
x(s,t)  ast  bs  ct  d
x(s,t)  (at  b)s  (ct  d) -- hold t constant  linear in s
x(s,t)  (as  c)t  (bs  d) -- hold s constant  linear in t

Bicubic:
x(s,t)  as 3t 3  bs 3t 2  cs 3t 2  ds 3  es 2t 3  fs 2t 2  gs 2t  hs 2
 ist 3  jst 2  kst  ls  mt 3  nt 2  ot  p
x(s,t)  (at 3  bt 2  ct  d)s 3  (et 3  ft 2  gt  h)s 2
-- hold t constant  cubic in s
(it 3  jt 2  kt  l)s  (mt 3  nt 2  ot  p)
x(s,t)  (as 3  es 2  is  m)t 3  (bs 3  fs 2  js  n)t 2
-- hold s constant  cubic in t
(cs 3  gs 2  ks  o)t  (ds 3  hs 2  ls  p)
31
Bilinear Patch (control mesh)

A bilinear patch is defined by a control mesh with four points p0, p1, p2, p3


AKA a (possibly-non-planar) quadrilateral
Compute x(u,v) using a two-step construction
p2
p3
v
p0
p1
u
32
Bilinear Patch (step 1)


For a given value of u, evaluate the linear curves on the two u-direction edges
Use the same value u for both:
q0=Lerp(u,p0,p1)
q1=Lerp(u,p0,p1)
q1
p2
p3
v
p0
q0
p1
u
33
Bilinear Patch (step 2)

Consider that q0, q1 define a line segment. Evaluate it using v to get x
x  Lerp(v, q 0 , q1 )
q1
p2
p3
x
v
p0
q0
p1
u
34
Bilinear Patch (full)

Combining the steps, we get the full formula
x(u, v)  Lerp(v, Lerp(u, p 0 , p1 ), Lerp(u, p 2 , p 3 ))
q1
p2
p3
x
v
p0
q0
p1
u
35
Bilinear Patch (other order)

Try the other order: evaluate first in the v direction
r0  Lerp(v, p 0 , p 2 )
r1  Lerp(v, p1 , p 3 )
p2
p3
r0
r1
v
p0
p1
u
36
Bilinear Patch (other order, step 2)

Consider that r0, r1 define a line segment. Evaluate it using u to get x
x  Lerp(u, r0 , r1 )
p2
p3
x
r0
r1
v
p0
p1
u
37
Bilinear Patch (other order, full)

The full formula for the v direction first:
x(u, v)  Lerp(u, Lerp(v, p 0 , p 2 ), Lerp(v, p1 , p 3 ))
p2
p3
x
r0
r1
v
p0
p1
u
38
Bilinear Patch (either order)

It works out the same either way!
x(u, v)  Lerp(v, Lerp(u, p 0 , p1 ), Lerp(u, p 2 , p 3 ))
x(u, v)  Lerp(u, Lerp(v, p 0 , p 2 ), Lerp(v, p1 , p 3 ))
q1
p2
p3
x
r0
r1
v
p0
q0
p1
u
39
Bilinear Patch
p2
p2
p1
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.
p3
p0
p1
p3
p0
40
Bilinear patch formulations
 As a weighted average of control points:
x(u, v)  (1  u)(1  v)p 0  u(1  v)p1  (1  u)vp 2  uvp 3
 In polynomial form:
x(u, v)  (p 0  p1  p 2  p 3 )uv  (p1  p 0 )u  (p 2  p 0 )v  p 0
41
Bilinear patch: Matrix form
 We have this matrix form for linear curves:
 1 1   t 
x(t)  p 0 p1 
 
 1 0  1
 Can derive this for bilinear patches:
 1
x x (u, v)  v 1
1
 1
x y (u, v)  v 1
1
1   p 0 x p1x   1
0   p 2 x p 3x   1
1   p 0 y p1y   1
0   p 2 y p 3y   1
1  u 
0   1 
1  u 
0   1 
 1 1   p 0 z p1z   1 1  u 
x z (u, v)  v 1


 
 1 0   p 2 z p 3z   1 0   1 
Gx, y,z
BTLin
BLin U
VT
 Compactly, we have:
C x  BTLinG x B Lin 
 VT C x U 




x(u, v)   VT C y U  where C y  BTLinG y B Lin  are constants
 C  BT G B 
 VT C z U 
Lin z Lin 
 z
42
Bilinear Patch

Properties of the bilinear patch:




Interpolates the control points
The boundaries are straight line segments connecting the control points
If the all 4 points of the control mesh are co-planar, the patch is flat
If the points are not coplanar, get a curved surface
•

saddle shape, AKA hyperbolic paraboloid
The parametric curves are all straight line segments!
•
a (doubly) ruled surface: has (two) straight lines through every point
p2
p2
p1
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (LZW) decompressor
are needed to see this picture.
p3
p0

p1
p3
p0
Kinda nifty, but not terribly useful as a modeling primitive
43
Bézier Control Mesh

A bicubic patch has a grid of 4x4 control points, p0 through p15



Defines four Bézier curves along u: p0,1,2,3; p4,5,6,7; p8,9,10,11; p12,13,14,15
Defines four Bézier curves along v: p0,4,8,12; p1,6,9,13; p2,6,10,14; p3,7,11,15
Evaluate using same approach as bilinear…
p12
p13
p8
v
p4
p0
p9
p14
p5
p10
p1
p11
p6
u
p15
p7
p2
p3
44
Bézier patch (step 1)

Evaluate all four of the u-direction Bézier curves at u, to get points q0 … q3
q0  Bez(u,p 0 ,p1 ,p 2 ,p 3 )
q1  Bez(u,p 4 ,p 5 ,p 6 ,p 7 )
q2  Bez(u,p 8 ,p 9 ,p10 ,p11 )
q 3  Bez(u,p12 ,p13 ,p14 ,p15 )
p12
p13 q3
p8
v
p4
p0
u
p9
p5
p14
q2
q1
p10
p1
p11
p6
q0
p15
p7
p2
p3
45
Bézier patch (step 2)

Consider that points q0 … q3 define a Bézier curve; evaluate it at v
x(u, v)  Bez(v, q0 , q1 , q2 , q 3 )
p12
p13 q3
p8
v
p4
p0
u
x
p9
p5
q2
q1
p14
p10
p1
p11
p6
q0
p15
p7
p2
p3
46
Bézier patch (either order)

Sure enough, you get the same result in either order.
q0  Bez(u, p 0 , p1 , p 2 , p 3 )
r0  Bez(v, p 0 , p 4 , p 8 , p12 )
q1  Bez(u, p 4 , p 5 , p 6 , p 7 )
r1  Bez(v, p1 , p 5 , p 9 , p13 )
q2  Bez(u, p 8 , p 9 , p10 , p11 ) 
r2  Bez(v, p 2 , p 6 , p10 , p14 )
q 3  Bez(u, p12 , p13 , p14 , p15 )
r3  Bez(v, p 3 , p 7 , p11 , p15 )
x(u, v)  Bez(v, q0 , q1 , q2 , q 3 )
x(u, v)  Bez(u, r0 , r1 , r2 , r3 )
r0
p8
v
p12
p4
p0
u
r1
p9
p5
p13 q3
x
q2
p14
r2
q1
r3
p10
p1
p11
p6
q0
p15
p7
p2
p3
47
Bézier patch

Properties:





Convex hull: any point on the surface will fall within the convex hull of the control points
Interpolates 4 corner points.
Approximates other 12 points, which act as “handles”
The boundaries of the patch are the Bézier curves defined by the points on the mesh edges
The parametric curves are all Bézier curves
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
a dna ™emiTkciuQ
rosserpmoced )desserpmocnU( F FIT
.erutcip siht ees ot dedeen era
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
48
Evaluating a Bézier patch

Most straightforward: follow the 2-step construction



Lets you evaluate patch using existing methods for evaluting curves
Won’t write out the weighted average or polynomial forms
But can do matrix form…
49
Bézier patch, matrix form
u 3 
 2
u 

U
u
 
1
v3 
 2
v 

V
v
 
1
C x  BTBez G x B Bez
C y  BTBez G y B Bez
C z  BTBez G z B Bez
 1 3 3 1 
 3 6 3 0 
  BTBez
B Bez  
 3 3 0 0 


1
0
0
0


 p0 x p1x p2 x p3x 
p

p
p
p
4x
5x
6x
7x 
Gx  
, Gy =
 p8 x p9 x p10 x p11x 


p
p
p
p
 12 x
13x
14 x
15 x 
, Gz =
 VT C x U 


x u, v    VT C y U 
 VT C z U 
50
Bézier patch, matrix form











Cx stores the coefficients of the bicubic equation for x
Cy stores the coefficients of the bicubic equation for y
Cz stores the coefficients of the bicubic equation for z
Gx stores the geometry (x components of the control points)
Gy stores the geometry (y components of the control points)
Gz stores the geometry (z components of the control points)
BBez is the basis matrix (Bézier basis)
U and V are the vectors formed from the powers of u and v
Compact notation
Leads to efficient method of computation
Can take advantage of hardware support for 4x4 matrix arithmetic
51
Tangents of Bézier patch

The “q” and “r” curves we constructed are actually the parametric curves at x(u,v)




Remember, tangents to surface = tangents to parametric curves
So we can compute the tangents using the same construction curves
Notice that the tangent in the u direction is for the curve that varies in u, i.e. for the “r” curve;
Similarly, the tangent in the v direction is for the “q” curve.
(Get the normal as usual by taking cross product of the tangents)
r0
p8
v
p0
u
p13
r1 q3
p12
p4
x
v
x
p9
p5
q2
p14
r2
q1
x
u
r3
p10
p1
p11
p6
q0
p15
p7
p2
p3
52
Tangents of Bézier patch, construction
q 0  Bez(u, p 0 , p1 , p 2 , p 3 )
q1  Bez(u, p 4 , p 5 , p 6 , p 7 )
r0  Bez(v, p 0 , p 4 , p 8 , p12 )
r1  Bez(v, p1 , p 5 , p 9 , p13 )
q 2  Bez(u, p 8 , p 9 , p10 , p11 )
q 3  Bez(u, p12 , p13 , p14 , p15 )
r2  Bez(v, p 2 , p 6 , p10 , p14 )
r3  Bez(v, p 3 , p 7 , p11 , p15 )
x
(u, v)  Bez(u, r0 , r1 , r2 , r3 )
u
x
(u, v)  Bez(v, q 0 , q1 , q 2 , q 3 )
v
r0
p8
v
p0
u
p13
r1 q3
p12
p4
x
v
x
p9
p5
q2
p14
r2
q1
x
u
r3
p10
p1
p11
p6
q0
p15
p7
p2
p3
53
Tangents of Bézier patch, matrix form

The matrix form makes it easy to evaluate the tangents directly:
u 3 
 3u 2 
 2


u
2u

U    U  
u
 1 
 


1
0
 


v3 
 3v 2 
 2
 
v
2v
V    V   
v
 1 
 
 
1
 
 0 
 VT C x U 


x(u, v)   V T C y U 
 V T C z U 
 V C x U 
x


(u, v)   V T C y U 
u
 V T C z U 
T
 VT C U 
x


x
T
(u, v)   V C y U 


v
 VT C U 
z


54
Tessellating a Bézier patch

Uniform tessellation is most straightforward




Evaluate points on a grid
Compute tangents at each point, take cross product to get per-vertex normal
Draw triangle strips (several choices of direction)
Adaptive tessellation/recursive subdivision


Potential for “cracks” if patches on opposite sides of an edge divide differently
Tricky to get right, but can be done.
55
Building a surface from Bézier patches


Lay out grid of adjacent meshes
For C0 continuity, must share points on the edge



Each edge of a Bézier patch is a Bézier curve based only on the edge mesh points
So if adjacent meshes share edge points, the patches will line up exactly
But we have a crease…
56
C1 continuity across Bézier edges

We want the parametric curves that cross each edge to
have C1 continuity

So the handles must be equal-and-opposite across the edge:
http://www.spiritone.com/~english/cyclopedia/patches.html
57
Modeling with Bézier patches

Original Utah teapot specified as Bézier Patches
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
58
Modeling Headaches

Original Teapot isn’t “watertight”





spout & handle intersect with body
no bottom
hole in spout
gap between lid and body
Rectangular topology makes it hard to:



join or abut curved pieces
build surfaces with holes
build surfaces with awkward topology or structure
59
Advanced surface modeling


B-spline patches
For the same reason as using B-spline curves



More uniform behavior
Better mathematical properties
Doesn’t interpolate any control points
60
Advanced surface modeling

NURBS surfaces.

Can take on more shapes
• conic sections
• kinks


Can blend, merge, fillet, …
Still has rectangular topology, though
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
61
Advanced surface modeling

Trim curves: cut away part of surface


Implement as part of tessellation/rendering
And/or construct new geometry
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
62
Subdivision Surfaces

Arbitrary mesh, not rectangular topology




Can make surfaces with arbitrary topology or
connectivity
Work by recursively subdividing mesh faces


Not parametric
No u,v parameters
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Per-vertex annotation for weights, corners,
creases
Used in particular for character animation:


One surface rather than collection of patches
Can deform geometry without creating cracks
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
63
Done

Next class:



Scan Conversion
Midterm review
Class after that:

Midterm!
64
Download