You are on page 1of 65

Parametric Surfaces

COS 426, Spring 2021


Felix Heide
Princeton University
3D Object Representations
• Points • Solids
 Range image  Voxels
 Point cloud  BSP tree
 CSG
 Sweep
• Surfaces
 Polygonal mesh
➢ Parametric • High-level structures
 Subdivision  Scene graph
 Implicit  Application specific
Parametric Surfaces
• Applications
 Design of smooth surfaces in cars, ships, etc.
Parametric Surfaces
• Applications
 Design of smooth surfaces in cars, ships, etc.
Parametric Surfaces
• Applications
 Design of smooth surfaces in cars, ships, etc.
 Creating characters or scenes for movies
Parametric Curves
• Applications
 Defining motion trajectories for objects or cameras

AutoDesk
Parametric Curves
• Applications
 Defining motion trajectories for objects or cameras
 Defining smooth interpolations of sparse data

Google
Street View
Outline
• Parametric curves
 Cubic B-Spline
 Cubic Bézier

• Parametric surfaces
 Bi-cubic B-Spline
 Bi-cubic Bézier
Outline
➢ Parametric curves
 Cubic B-Spline
 Cubic Bézier

• Parametric surfaces
 Bi-cubic B-Spline
 Bi-cubic Bézier
Parametric Curves
• Defined by parametric functions:
 x = fx(u)
 y = fy(u)
P1

• Example: line segment u


f x (u ) = (1 − u ) x0 +ux1
P0
f y (u ) = (1 − u ) y0 +uy1
u  [0..1]
H&B Figure 10.10
Parametric Curves
• Defined by parametric functions:
 x = fx(u)
 y = fy(u)
y

ry
• Example: ellipse
f x (u) = rx cos(2p u) u rx x
f y (u) = ry sin(2p u)
u Î [0..1]
H&B Figure 10.10
Parametric curves
How to easily define arbitrary curves?

x = fx(u)
y = fy(u)
Parametric curves
How to easily define arbitrary curves?

x = fx(u) V1
y = fy(u)
u
V0

Use functions that “blend” control points

x = fx(u) = V0x*(1 - u) + V1x*u


y = fy(u) = V0y*(1 - u) + V1y*u

Simple functions of u
Parametric curves
More generally:
n
x(u ) =  Bi (u ) *Vix
i =0
n
y (u ) =  Bi (u ) *Vi y
i =0

x(u), y(u) V2
V1 V3

V0
Parametric curves
What B(u) functions should we use?
n
x(u ) =  Bi (u ) *Vix
i =0
n
y (u ) =  Bi (u ) *Vi y
i =0
Parametric curves
What B(u) functions should we use?
n
x(u ) =  Bi (u ) *Vix
V1
i =0
n
y (u ) =  Bi (u ) *Vi y V0
i =0

B0 B1
1 1

0 0
0 1 u 0 1 u
Parametric curves
What B(u) functions should we use?
n
x(u ) =  Bi (u ) *Vix
V1
i =0
n
y (u ) =  Bi (u ) *Vi y V0
i =0
V2

B0 B1 B2
1 1 1

0 0 0
0 1 2 u 0 1 2 u 0 1 2 u
Parametric Polynomial Curves
• Polynomial blending functions:
V1

V0 V2

• Advantages of polynomials
 Easy to compute
 Easy to derive curve properties
Parametric Polynomial Curves
• Polynomial blending functions:
V1

V0 V2

V1

• What degree polynomial?


 Easy to compute V0 V2
 Easy to control
 Expressive
Piecewise Parametric Polynomial Curves
• Splines:
 Split curve into segments V0
 Each segment defined by low-order polynomial
V1
blending subset of control vertices

• Motivation: V2
 Same blending functions for every segment V
3
 Prove properties from blending functions
 Provides local control & efficiency
V4
• Challenges
 How choose blending functions?
 How determine properties? V5
V6
Cubic Splines
• Some properties we might like to have:
 Local control V0
 Continuity m
Bi (u ) =  a j u j V1
 Interpolation? j =0
 Convex hull?
V2
V3
Blending functions determine properties

V4
Properties determine blending functions

V5
V6
Outline
• Parametric curves
➢ Cubic B-Spline
 Cubic Bézier

• Parametric surfaces
 Bi-cubic B-Spline
 Bi-cubic Bézier
Cubic B-Splines
• Properties: V0
 Local control
 C2 continuity at joints V1
(infinitely continuous within each piece)
 Approximating
 Convex hull
V3 V2

V4

V5
Cubic B-Splines
Notes on continuity

[from Robert Duvall] [from Carlo Séquin]


Cubic B-Splines
Notes on local control:

and convex hull property:

[from Steve Marschner]


Cubic B-Spline Blending Functions
Blending functions: V0
m
Bi (u ) =  a j u j V1
j =0

b-0 b-1
1 1
V3 V2
0 0
0 1 0 1
b-2 b-3
1 1
V4

0
0
0
0
V5
1 1
Cubic B-Spline Blending Functions
• How derive blending functions? V0
 Cubic polynomials
 Local control V1
 C2 continuity
 Convex hull

1
V3 V2
b-1 b-2

b-0 b-3 V4
0
V0 V1 V2 V3 V4 V5 u
V5
Cubic B-Spline Blending Functions
• Four cubic polynomials for four vertices V0
 16 variables (degrees of freedom)
 Variables are ai, bi, ci, di for V1
four blending functions

V3 V2
b−0 (u ) = a0u + b0u + c0u + d 0
3 2 1

b−1 (u ) = a1u 3 + b1u 2 + c1u1 + d1


V4
b− 2 (u ) = a2u 3 + b2u 2 + c2u1 + d 2
b−3 (u ) = a3u 3 + b3u 2 + c3u1 + d 3
V5
Cubic B-Spline Blending Functions
• C2 continuity implies 15 constraints V0
 Position of two curves same
 Derivative of two curves same V1
 Second derivatives same

V3 V2

V4

V5
Cubic B-Spline Blending Functions
Cubic B-Spline Blending Functions
• Solving the system of equations yields:
Cubic B-Spline Blending Functions
• In matrix form:

 −1 3 − 3 1  V0 
  
1  3 −6 3
Q (u ) = (u 3 u 2 u 1) 
0   V1 
6 −3 0 3 0  V2 
   
 1 4 1 0  V3 
Cubic B-Spline Blending Functions
In plot form:
m
Bi (u ) =  a j u j
j =0
V1 V2

V0 V3
Cubic B-Spline Blending Functions
In plot form backwards: V0

V1

B-0 B-1
1 1
V3 V2
0 0
0 1 0 1
B-2 B-3
1 1

0 0
0 1 0 1
Cubic B-Spline Blending Functions
• Blending functions imply properties: V0
 Local control
 Approximating V1
 C2 continuity
 Convex hull

1
V3 V2

V4
0
V0 V1 V2 V3 V4 V5 u
V5
Try online at http://bl.ocks.org/mbostock/4342190
Outline
• Parametric curves
 Cubic B-Spline
➢ Cubic Bézier

• Parametric surfaces
 Bi-cubic B-Spline
 Bi-cubic Bézier
Bézier Curves
• Developed around 1960 by both
 Pierre Bézier (Renault) V0
 Paul de Casteljau (Citroen)
V1
• Today: graphic design (e.g. FONTS)
• Properties: V2
V3
 Local control
 Continuity depends on control points
 Interpolating (every third for cubic) V4

Blending functions determine properties


V5
V6
Cubic Bézier Curves
Blending functions:
m V0
Bi (u ) =  a j u j

j =0 V1
Bi-3 Bi-2
1 1
V2
V3
0 0
0 1 0 1
Bi-1 Bi
1 1
V4

0
0
0
0
V5
1 1
V6
Cubic Bézier Curves
Bézier curves in matrix form:
n
n i
Q (u ) = Vi   u (1 − u )n −i
i =0 i
= (1 − u )3V0 + 3u(1 − u )2V1 + 3u 2 (1 − u )V2 + u 3V3
 −1 3 − 3 1  V0 
  
 3 −6 3
= (u 3 u 2 u 1) 
0   V1 
−3 3 0 0  V2 
   
 1 0 0 0  V3 

MBézier
Basic properties of Bézier Curves
• Endpoint interpolation:
Q (0) = V0
Q(1) = Vn

• Convex hull:
 Curve is contained within convex hull of control polygon

• Symmetry
Q(u) defined by {V0 ,...,Vn }  Q(1 − u) defined by {Vn ,...,V0}
Bézier Curves
• Curve Q(u) can also be defined by
nested interpolation:

V1
V2

Q(u)
V0
V3

Vi are control points


{V0, V1, …, Vn} is control polygon
Enforcing Bézier Curve Continuity
• C0: V3 = V4
• C1: V5-V4 = V3-V2
• C2: V6-2V5+V4 = V3-2V2+V1
V1
V2

V0 V3
V7
V4

V5
V6
Outline
• Parametric curves
 Cubic B-Spline
 Cubic Bézier

➢ Parametric surfaces
 Bi-cubic B-Spline
 Bi-cubic Bézier
Parametric Surfaces
• Defined by parametric functions:
 x = fx(u,v)
 y = fy(u,v)
 z = fz(u,v)
y
Parametric functions
v define mapping from
(u,v) to (x,y,z):
v

u x
u
z

FvDFH Figure 11.42


Parametric Surfaces
• Defined by parametric functions:
 x = fx(u,v) P2 P3
 y = fy(u,v)
 z = fz(u,v)
v

• Example: quadrilateral P0
u P1

f x (u , v) =(1 − v)((1 − u ) x0 + ux1 ) + v((1 − u ) x2 + ux3 )


f y (u , v) =(1 − v)((1 − u ) y0 + uy1 ) + v((1 − u ) y2 + uy3 )
f z (u , v) =(1 − v)((1 − u ) z0 + uz1 ) + v((1 − u ) z 2 + uz3 )
Parametric Surfaces
• Defined by parametric functions:
 x = fx(u,v) P2 P3
 y = fy(u,v)
 z = fz(u,v)
v

• Example: quadrilateral P0
u P1

f x (u, v) =(1 − v)((1 − u ) x0 + ux1 ) + v((1 − u ) x2 + ux3 )


f y (u, v) =(1 − v)((1 − u ) y0 + uy1 ) + v((1 − u ) y2 + uy3 )
f z (u, v) =(1 − v)((1 − u ) z0 + uz1 ) + v((1 − u ) z2 + uz3 )
Parametric Surfaces
• Defined by parametric functions:
 x = fx(u,v)
 y = fy(u,v)
 z = fz(u,v)

• Example: ellipsoid
f x (u, v) = rx cosv cosu
f y (u, v) = ry cosvsin u
fz (u, v) = rz sin v
H&B Figure 10.10
Parametric Surfaces
To model arbitrary shapes, surface is partitioned
into parametric patches

Catnull
Parametric Patches
• Each patch is defined by blending control points

Same ideas as parametric curves!


FvDFH Figure 11.44
Parametric Patches
• Point Q(u,v) on the patch is the tensor product of
parametric curves defined by the control points

Q(u,v)?
Q(0,1)
Q(1,1)

Q(0,0)

Q(1,0)

Watt Figure 6.21


Parametric Patches
• Point Q(u,v) on the patch is the tensor product of
parametric curves defined by the control points

Q(0,1)
Q(1,1)

Q(0,0)

Q(1,0)

Watt Figure 6.21


Parametric Patches
• Point Q(u,v) on the patch is the tensor product of
parametric curves defined by the control points

Q(0,1)
Q(1,1)

u=0.4
u=0.4
Q(0,0)

Q(1,0)

Watt Figure 6.21


Parametric Patches
• Point Q(u,v) on the patch is the tensor product of
parametric curves defined by the control points

Q(0,1)
Q(1,1)

u=0.4
u=0.4
Q(0,0)

Q(1,0)

Watt Figure 6.21


Parametric Patches
• Point Q(u,v) on the patch is the tensor product of
parametric curves defined by the control points

Q(u,v)
Q(0,1)
Q(1,1)

u=0.4 v=0.5
u=0.4
Q(0,0)

Q(1,0)

Watt Figure 6.21


Parametric Bicubic Patches
Point Q(u,v) on any patch is defined by combining
control points with polynomial blending functions:

U = [u 3
u 2
u 1] V = [v 3
v 2
v 1]

Where M is a matrix describing the blending functions


for a parametric cubic curve (e.g., Bézier, B-spline, etc.)
B-Spline Patches

Watt Figure 6.28


Bézier Patches

FvDFH Figure 11.42


Bézier Patches
• Properties:
 Interpolates four corner points
 Convex hull
 Local control

Watt Figure 6.22


Piecewise Polynomial Parametric Surfaces

Surface is composition of many parametric patches

Catnull
Piecewise Polynomial Parametric Surfaces

Must maintain continuity across seams

Same ideas as parametric splines!


Watt Figure 6.25
Bézier Surfaces
• Continuity constraints are similar to the ones for
Bézier splines

FvDFH Figure 11.43


Bézier Surfaces
• C0 continuity requires aligning boundary curves

Watt Figure 6.26a


Bézier Surfaces
• C1 continuity requires aligning boundary curves
and derivatives

Watt Figure 6.26b


Parametric Surfaces
• Properties
? Natural parameterization
? Guaranteed smoothness
? Intuitive editing
? Concise
? Accurate
? Efficient display
? Easy acquisition
? Efficient intersections
? Guaranteed validity
? Arbitrary topology
Parametric Surfaces
• Properties
☺Natural parameterization
☺Guaranteed smoothness
☺Intuitive editing
☺Concise
☺Accurate
o Efficient display
Easy acquisition
Efficient intersections
Guaranteed validity
Arbitrary topology

You might also like