0% found this document useful (0 votes)
115 views25 pages

Modeling Curves and Surfaces: G. Drew Kessler (Modified by H.Quynh Dinh 3/2003)

The document discusses modeling curves and surfaces. It describes representing curves and surfaces using piecewise linear approximations or higher-order formulae. Higher-order formulae like parametric equations use fewer points and less storage than piecewise approximations while providing smoother representations. Specific curve types are discussed, including Hermite curves defined by endpoints and tangent vectors, and Bézier curves defined by endpoints and control points. Continuity between joined curve segments is also covered.

Uploaded by

kamlaxmi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views25 pages

Modeling Curves and Surfaces: G. Drew Kessler (Modified by H.Quynh Dinh 3/2003)

The document discusses modeling curves and surfaces. It describes representing curves and surfaces using piecewise linear approximations or higher-order formulae. Higher-order formulae like parametric equations use fewer points and less storage than piecewise approximations while providing smoother representations. Specific curve types are discussed, including Hermite curves defined by endpoints and tangent vectors, and Bézier curves defined by endpoints and control points. Continuity between joined curve segments is also covered.

Uploaded by

kamlaxmi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

Modeling Curves and

Surfaces

G. Drew Kessler (modified by


H.Quynh Dinh 3/2003) 1
Curves and Surfaces
 Observation: Many objects we want to model and display
are not straight or flat.
 Ex. Text, sketches, chairs, animals, plants, buildings.

 How can we represent a curve?


 A large number of points on the curve.

 Approximate with connected line segments.

 “piecewise linear approximation”


 How can we represent a surface?
 A large number of points on the surface.

 Approximate with a polygon mesh.

 Set of polygons where each edge is part of only 1 or 2 polygons.


G. Drew Kessler 2
Accuracy/Space Trade-off
Problem:
 Piecewise linear approximations require many pieces to
look good (realistic, smooth, etc.).
 Set of individual curve or surface points would take large
amounts of storage.
Solution:
 Higher-order formulae for coordinates on curve/surface.

 If a simple formula won’t work, subdivide curve/surface


into pieces that can be represented by simple formulae.
 May still be an approx., but uses much less storage.

 Downside: harder to specify and render.


G. Drew Kessler 3
Higher-order Formulae
Explicit Functions: y = f(x) [e.g. y=2x2]
 Only one value of y for each x

 Difficult to represent a slope of infinity

Implicit Equations: f(x,y)=0 [e.g. x2+y2-r2=0]


 Need constraints to model just one part of a curve

 Joining curves together smoothly is difficult

Parametric Equations: x=f(t), y=f(t) [e.g. x=t3+3,y=3t2+2t+1]


 Slopes represented as parametric tangent vectors (d/dt).

 Easy to join curve segments smoothly.

G. Drew Kessler 4
Parametric Curves
Select part of curve: 0  t  1
Linear: Quadratic: Cubic:

x=axt + bx x = a x t 2 + b xt + c x x = axt3 + bxt2 + cxt + dx

y=ayt + by y = ayt2 + byt + cy y = ayt3 + byt2 + cyt + dy

z=azt + bz z = azt2 + bzt + cz z = azt3 + bzt2 + czt + dz

Cubic preferred - A balance between flexibility and


complexity in specifying and computing shape.
• Need 4 known to determine 4 unknown coefficients.
G. Drew Kessler 5
Parametric Equations

x = axt3 + bxt2 + cxt + dx

y = ayt3 + byt2 + cyt + dy Q(t )  T  C


z = azt3 + bzt2 + czt + dz

ax ay az 
b by bz  
T t  3
t 2

t 1 C  x

 cx cy cz 
 
d x dy d z 
G. Drew Kessler 6
The Basis Matrix and Geometric Matrix
Q(t) = G M T
 m11 m21 m31 m41  t 3 
m m   2
 G1 G2 G3 G4   12 22 m32 m42 

m13 m23 m33 m43 


t 
t 
   
m14 m24 m34 m44  1 
Geometry Matrix Basis Matrix T Matrix
 Idea: Different curves can be specified by changing the
geometric information in the geometry matrix.
 The curve is the weighted sum of the elements of the

geometry matrix, G.
 The basis matrix contains constant values specific to a

family of curves.
G. Drew Kessler 7
Joining Curve Segments Together
G0 geometric continuity: Two curve segments join together

G1 geometric continuity: The direction of the two segments’


tangent vectors are equal at the join point

C1 (parametric) continuity: Tangent vectors of the two


segments are equal in magnitude and direction

(C1  G1 unless tangent vector = [0, 0, 0])

Cn (parametric) continuity: Direction and magnitude


through the nth derivative are equal at the join point

G. Drew Kessler 8
Joining Examples
Join point
C2
C1
C0
TV3

Q3
TV2
TV1

P1 Q2 P3
S joins C0, C1, and C2 with
P2 C0, C1, and C2 continuity,
respectively.

Q1

Q1 and Q2 are C1 continuous because their tangents, TV1


and TV2, are equal. Q1 and Q3 are only G1 continuous.
G. Drew Kessler 9
Curve Families

Family Type Defined by


Straight Line Linear 2 Endpoints

Hermite Cubic 2 Endpoints, Tangent


Vectors at Endpoints
Bézier Cubic 2 Endpoints, 2
“Control Points”
Splines Cubic 4 “Control Points”

G. Drew Kessler 10
Blending Function
 Blending functions of a curve family are defined by M•T
 Set of functions in t

 There is one blending function for each of the pieces of

geometric information in the G matrix.


 The value of a blending function at a certain value of t

determines the effect of the corresponding piece of


geometric information at that point along the curve.

G. Drew Kessler 11
Hermite Curves
Defined by two endpoints and tangents at the endpoints.

R1
P4
R4

P1

G. Drew Kessler 12
Hermite Curve Examples

R1

P4
P1

The set of Hermite curves that have the same values for R4
the endpoints P1 and P4, tangent vectors R1 and R4 of the
same direction, but with different magnitudes for R1. The
magnitude of R4 remains fixed.
G. Drew Kessler 13
Hermite Curve Examples (cont.)

All tangent vector magnitudes are equal, but the direction of


the left tangent vector varies.
G. Drew Kessler 14
Hermite Basis Matrix
t 3 
 2
t
Q(t )  GH  M H  T   P1 P4 R1 R4  M H  
t 
 
1 
0  0 
0  0 
P1  Q(0)  GH M H   R1  Q(0)  GH M H  
0  1 
   
1
  0 

1 3 
1  2
P4  Q(1)  GH M H   R4  Q(1)  GH M H  
1 1 
  
1 0 
G. Drew Kessler 15
Hermite Basis Matrix

0 1 0 3
0 1 0 2
 P1 P4 R1 R4    P1 P4 R1 R4  M H 
0 1 1 1
 
1 1 0 0

1
0 1 0 3  2 3 0 1
0 1 0 2  2 3 0 0
MH   
0 1 1 1  0 2 1 0
   
1 1 0 0  1 1 0 0

G. Drew Kessler 16
Hermite Blending Functions
Q(t) = T•MH•GH

Q (t ) 
f(t)
(2t  3t  1) P1 
3 2
1 P1 P4

(2t  3t ) P4 
3 2

R1 (t  2t  t ) R1 
3 2

t
R4 (t 3  t 2 ) R4

G. Drew Kessler 17
Bézier Curves
Curves for four control points, P1, P2, P3, and P4

P3 P2

P4
P1 P1
P4
P2 P3
Convex Hull

G. Drew Kessler 18
Bézier Matrices t 3

 2
Q(t) = GB•MB•T  t 
T
t 
 
• P1 & P4: endpoints 1 
• R1 = 3(P2-P1), R4 = 3(P4-P3)  1 3  3 1
 3 6 3 0
• constant velocity curves if
control points are equally MB  
 3 3 0 0
spaced  
1 0 0 0
GB   P1 P2 P3 P4 
G. Drew Kessler 19
Bézier Blending Functions

f(t) Q(t )  (t  3t  3t  1) P1 


3 2
1

BB1 BB4 (3t  6t  3t ) P2 


3 2

BB2 BB3

(3t  3t ) P3 
3 2

3
1
t
t P4
The Bernstein polynomials:
BB1  (1  t ) 3 BB2  3t (1  t ) 2
BB3  3t 2 (1  t ) BB4  t 3
G. Drew Kessler 20
Bézier Curve Characteristics
1. The functions interpolate the first and last vertex points.
2. The tangent at P1 is given by P2-P1, and the tangent at Pn+1 by Pn+1-
Pn.
3. The blending functions are symmetric with respect to t and (1-t). This
means we can reverse the sequence of vertex points defining the curve
without changing the shape of the curve.
4. The curve, Q(t), lies within the convex hull defined by the control
points.
5. If the first and last vertices coincide, then we produce a closed curve.
6. If complicated curves are to be generated, they can be formed by
piecing together several Bézier sections.
7. By specifying multiple coincident points at a vertex, we pull the curve
in closer and closer to that vertex.

G. Drew Kessler 21
Splines
 It’s easy to ensure joins between Hermite or Bézier are G1
or C1 (tangents defined directly), but ensuring C2 is not.
 A spline is a curve that is C2 continuous through-out.

 A natural spline is defined by n control points.


 The curve may or may not pass through any one control

point.
 Moving one control point changes the entire curve.

 Calculating the coefficients for the n+1 degree polynomial

is computationally expensive.
G. Drew Kessler 22
B-Splines
 A B-Spline defines a curve with m+1 control points, P 0,
P1, ... Pm, m3, which define m-2 connected, cubic
polynomial, curve segments, Q3 to Qm.
 The curve segments join at knots, and the endpoints of the
entire curve are also called knots: m-1 knots.
 A curve segment Qi is defined by the control points Pi-3, Pi-2,
Pi-1, and Pi.
P9 P8
P1 P3
Q5 P4 Q9
Key feature: moving a control P7
Q8
point has a local effect. Q3 Q6
Q4 Q7 P6
Effects four curve segments.

P0 P5
P2
G. Drew Kessler 23
B-Splines (cont.)
 Uniform B-Splines have knots at equal intervals in t.
 Distances in t between adjacent knots are the same.

 Blending functions for each curve segment are the same.

 Nonuniform B-Splines: parametric intervals between


knots are not equal.
 Add 3 knots at each end, m+3 for m+1 control points.

 Can reduce continuity by having a 0 length interval

between knots.
 Nonuniform Rational B-Splines (NURBS) are commonly
used in 3D modeling systems.
 Curves are invariant under perspective transformations.

G. Drew Kessler 24
Surfaces
 Can extend parametric cubic curves to a surface.
 Parametric bicubic surface

 Use two parameters, s and t, rather than just one.


 Q(s, t)

 Q(s, t ) is a parametric cubic curve, as is Q(s , t)


c c
t

Q(sc, t) Q(s, tc)

s
 Surface defined by 16 coefficients (16 known values).
G. Drew Kessler 25

You might also like