Download presentation
Presentation is loading. Please wait.
Published byUrsula McBride Modified over 9 years ago
1
1 Dr. Scott Schaefer Smooth Curves
2
2/109 Smooth Curves Interpolation Interpolation through Linear Algebra Lagrange interpolation Bezier curves B-spline curves
3
3/109 Smooth Curves How do we create smooth curves?
4
4/109 Smooth Curves How do we create smooth curves? Parametric curves with polynomials
5
5/109 Smooth Curves Controlling the shape of the curve
6
6/109 Smooth Curves Controlling the shape of the curve
7
7/109 Smooth Curves Controlling the shape of the curve
8
8/109 Smooth Curves Controlling the shape of the curve
9
9/109 Smooth Curves Controlling the shape of the curve
10
10/109 Smooth Curves Controlling the shape of the curve
11
11/109 Smooth Curves Controlling the shape of the curve
12
12/109 Smooth Curves Controlling the shape of the curve
13
13/109 Smooth Curves Controlling the shape of the curve
14
14/109 Smooth Curves Controlling the shape of the curve Power-basis coefficients not intuitive for controlling shape of curve!!!
15
15/109 Interpolation Find a polynomial that passes through specified values
16
16/109 Interpolation Find a polynomial that passes through specified values
17
17/109 Interpolation Find a polynomial that passes through specified values
18
18/109 Interpolation Find a polynomial that passes through specified values
19
19/109 Interpolation Find a polynomial that passes through specified values Intuitive control of curve using “control points”!!!
20
20/109 Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
21
21/109 Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
22
22/109 Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
23
23/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
24
24/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
25
25/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
26
26/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
27
27/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
28
28/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
29
29/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
30
30/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
31
31/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
32
32/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
33
33/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
34
34/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
35
35/109 Lagrange Interpolation Identical to matrix method but uses a geometric construction
36
36/109 Uniform Lagrange Interpolation Base Case Linear interpolation between two points Inductive Step Assume we have points y i, …, y n+1+i Build interpolating polynomials f(t), g(t) of degree n for y i, …, y n+i and y i+1, …, y n+1+i h(t) interpolates all points y i, …, y n+1+i and is of degree n+1 Moreover, h(t) is unique
37
37/109 Lagrange Evaluation Pseudocode Lagrange(pts, i, t) n = length(pts)-2 if n is 0 return pts[0](i+1-t)+pts[1](t-i) f=Lagrange(pts without last element, i, t) g=Lagrange(pts without first element, i+1, t) return ((n+1+i-t)f+(t-i)g)/(n+1)
38
38/109 Problems with Interpolation
39
39/109 Problems with Interpolation
40
40/109 Bezier Curves Polynomial curves that seek to approximate rather than to interpolate
41
41/109 Bernstein Polynomials Degree 1: (1-t), t Degree 2: (1-t) 2, 2(1-t)t, t 2 Degree 3: (1-t) 3, 3(1-t) 2 t, 3(1-t)t 2, t 3
42
42/109 Bernstein Polynomials Degree 1: (1-t), t Degree 2: (1-t) 2, 2(1-t)t, t 2 Degree 3: (1-t) 3, 3(1-t) 2 t, 3(1-t)t 2, t 3 Degree 4: (1-t) 4, 4(1-t) 3 t, 6(1-t) 2 t 2, 4(1-t)t 3,t 4
43
43/109 Bernstein Polynomials Degree 1: (1-t), t Degree 2: (1-t) 2, 2(1-t)t, t 2 Degree 3: (1-t) 3, 3(1-t) 2 t, 3(1-t)t 2, t 3 Degree 4: (1-t) 4, 4(1-t) 3 t, 6(1-t) 2 t 2, 4(1-t)t 3,t 4 Degree 5: (1-t) 5, 5(1-t) 4 t, 10(1-t) 3 t 2, 10(1-t) 2 t 3,5(1-t)t 4,t 5 … Degree n: for
44
44/109 Bezier Curves
45
45/109 Bezier Curves
46
46/109 Bezier Curves
47
47/109 Bezier Curve Properties Interpolate end-points
48
48/109 Bezier Curve Properties Interpolate end-points
49
49/109 Bezier Curve Properties Interpolate end-points
50
50/109 Bezier Curve Properties Interpolate end-points
51
51/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge
52
52/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge
53
53/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge
54
54/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge Curve lies within the convex hull of the control points
55
55/109 Convex Hull The smallest convex set containing all points p i
56
56/109 Convex Hull The smallest convex set containing all points p i
57
57/109 Bezier Curve Properties Interpolate end-points Tangent at end-points in direction of first/last edge Curve lies within the convex hull of the control points Bezier Lagrange
58
58/109 Pyramid Algorithms for Bezier Curves Polynomials aren’t pretty Is there an easier way to evaluate the equation of a Bezier curve?
59
59/109 Pyramid Algorithms for Bezier Curves
60
60/109 Pyramid Algorithms for Bezier Curves
61
61/109 Pyramid Algorithms for Bezier Curves
62
62/109 Bezier Evaluation Pseudocode Bezier(pts, t) if ( length(pts) is 1) return pts[0] newPts={} For ( i = 0, i < length(pts) – 1, i++ ) Add to newPts (1-t)pts[i] + t pts[i+1] return Bezier ( newPts, t )
63
63/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
64
64/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
65
65/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
66
66/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
67
67/109 Subdividing Bezier Curves Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve
68
68/109 Subdividing Bezier Curves Control points for left curve!!!
69
69/109 Subdividing Bezier Curves Control points for right curve!!!
70
70/109 Subdividing Bezier Curves
71
71/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
72
72/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
73
73/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
74
74/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
75
75/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
76
76/109 Adaptive Rendering of Bezier Curves If control polygon is close to a line, draw the control polygon If not, subdivide and recur on subdivided pieces
77
77/109 Applications: Intersection Given two Bezier curves, determine if and where they intersect
78
78/109 Applications: Intersection Check if convex hulls intersect If not, return no intersection If both convex hulls can be approximated with a straight line, intersect lines and return intersection Otherwise subdivide and recur on subdivided pieces
79
79/109 Applications: Intersection
80
80/109 Applications: Intersection
81
81/109 Applications: Intersection
82
82/109 Applications: Intersection
83
83/109 Applications: Intersection
84
84/109 Applications: Intersection
85
85/109 Applications: Intersection
86
86/109 Applications: Intersection
87
87/109 Applications: Intersection
88
88/109 Applications: Intersection
89
89/109 Applications: Intersection
90
90/109 Application: Font Rendering
91
91/109 Application: Font Rendering
92
92/109 Problems with Bezier Curves More control points means higher degree Moving one control point affects the entire curve
93
93/109 Problems with Bezier Curves More control points means higher degree Moving one control point affects the entire curve
94
94/109 B-spline Curves Not a single polynomial, but lots of polynomials that meet together smoothly Local control
95
95/109 B-spline Curves Not a single polynomial, but lots of polynomials that meet together smoothly Local control
96
96/109 Rendering B-spline Curves Lane-Reisenfeld subdivision algorithm Linearly subdivide the curve by inserting the midpoint on each edge Perform averaging by replacing each edge by its midpoint d times Subdivide the curve repeatedly
97
97/109 Rendering B-spline Curves
98
98/109 Rendering B-spline Curves
99
99/109 Rendering B-spline Curves
100
100/109 Rendering B-spline Curves
101
101/109 Rendering B-spline Curves
102
102/109 Rendering B-spline Curves
103
103/109 Rendering B-spline Curves
104
104/109 Rendering B-spline Curves
105
105/109 Rendering B-spline Curves
106
106/109 B-spline Properties Curve lies within convex hull of control points Variation Diminishing: Curve wiggles no more than control polygon Influence of one control point is bounded Degree of curve increases by one with each averaging step Smoothness increases by one with each averaging step
107
107/109 B-spline Curve Example
108
108/109 B-spline Curve Example
109
109/109 B-spline Curve Example
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.