Curves and Splines
Sampling Theory
- An animation can be viewed as a function over time
- How to represent compactly and completely?
- Sample values and reconstruct underlying function
- Not an exact science
Making Smooth Curves
- Cubic polynomials offer variety and flexibility
- Goals when defining and editing, i.e., small changes to input cause small
changes in output
- local control of shape
- stability
- smoothness and continuity when combining
- ease of rendering
- Degrees of smoothness, i.e., continuity
- parametric: differentiability of parametric representation (C0, C1, C2, ...)
- geometric: smoothness of resulting displayed shape (G0=C0, G1=tangent-cont., G2=curvature-cont. )
Control Points
- Provide degrees of freedom, DOF, in specifying curve
- Levels of flexibility
- must be points on curve
- start and end of curve plus tangents at start and end
- no points on curve, instead curve is interpolated through points using blending functions
Splines
- Originally used in ship building to bend wood into hull shape
- Also used in model railroads
- Modeled in OpenGL using evaluators to generate vertices from array of control points
- Modeled in GLU using NURBS object
Spline Types and Animation
Different spline types will have different tradeoffs and capabilities:
- Hermite splines: Require tangent vectors at each keyframe.
- Bézier splines: Require additional information for each segment and do not automatically maintain continuity.
- Catmull-Rom splines: Provide only first derivative continuity.
- B-splines: Give automatic continuity control, but only approximate their control points.
- Non-uniform Rational B-splines (NURBS): Provide additional local control over the shape of a curve.
- Non-uniform B-splines: Are needed to break continuity.
Examples
- Construction of Bezier Curves Applet
- Build a variety of Splines Applet
- An Interactive Introduction to Splines
References
- Notes on Splines by Steve Marchner
- Note on Splines from CMU
- Note on Splines from UVA
- Notes on curves by Pankaj Agarwal
- Notes on NURBs in OpenGL by C. Ramakrishnan