Professional Documents
Culture Documents
08_ParametricCurves_Web
08_ParametricCurves_Web
08_ParametricCurves_Web
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 1 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 2
⎧ x = r cos(u )
x2 + y2 − r 2 = 0 ⎨
⎩ y = r sin(u )
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 3 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 4
Parametric Representation of Splines Parametric Representation of Splines
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 5 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 6
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 7 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 8
Interpolating vs. Approximating Splines Smoothness
• interpolating • approximating • smoothness described by degree of continuity
– pass through control points – guided by control points – C0: same position at each side of joints
– C1: same tangent at each side of joints
– C2: same curvature at each side of joints
– Cn: n-th derivative defined at joints
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 9 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 10
Control Control
yes
no
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 11 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 12
Efficiency Piecewise Linear Splines
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 13 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 14
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 15 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 16
Joining Line Segments Hermite Splines
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 19 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 20
Bezier Splines Bezier Splines
⎡ −1 3 − 3 1⎤ ⎡q 0 ⎤
⎢ 3 −6 3 0⎥ ⎢ q1 ⎥
p(t ) = [t 3 t2 t 1]⎢ ⎥⎢ ⎥
⎢− 3 3 0 0⎥ ⎢q 2 ⎥
⎢1
⎣ 0 0 0⎥⎦ ⎢⎣q 3 ⎥⎦
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 21 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 22
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 23 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 24
Piecewise Cubic Splines – Control Piecewise Cubic Splines – Affine Invariance
X (p(t )) = Mp(t ) + t = M (∑ 3
i =0 i
)
b (t )p i + t =
• convex hull
= ∑i =0 bi (t ) Mp i + ∑i =0 bi (t )t =
3 3
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 25 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 26
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 27 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 28
Catmull-Rom Splines Drawing Splines
p'k = (p k +1 − p k −1 ) / 2 • approximate with a sequence of line segments
– efficiency: fast evaluation, small number of segments
– guarantees on accuracy
• approaches
– uniform subdivision in t (fast)
– recursive subdivision (small number of segments)
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 29 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 30
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 31 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 32
De Casteljau Algorithm - Bezier B-Splines
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 33 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 34
Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 35 Computer Graphics • Parametric Curves © 2005 Fabio Pellacini • 36
2D vs. 3D splines