How to Draw Spline Curves
Basis matrix eqn. allows same code to draw any spline type
Method 1: brute force
- Calculate the coefficients
- For each cubic segment, vary u from 0 to 1 (fixed step size)
- Plug in u value, matrix multiply to compute position on curve
- Draw line segment from last position to current position
What’s wrong with this approach?
- Draws in even steps of u
- Even steps of u ? even steps of x
- Line length will vary over the curve
- Want to bound line length
- too long: curve looks jagged
- too short: curve is slow to draw