Interpolation


Linear: P = C1t + C0
C1 = P1 - P0       C0 = P0

Cubic: P = C3t3 + C2t2 + C1t + C0





Bezier Spline

Defined by 4 points.
Connects the first and last points; middle points control direction.

P(t) = (1 - t)3p0 + 3t(1 - t)2p1 + 3t2(1 - t)p2 + t3p3






Hermite Spline

Defined by 2 points, and tangents at those points

P(t) = (2t3 - 3t2 + 1)p0 + (t3 - 2t2 + t)m0 + (-2t3 + 3t2)p1 + (t3 - t2)m1






Catmull-Rom Spline

Defined by 4 points.
Curve passes through middle 2 points.


P = C3t3 + C2t2 + C1t + C0

C3 = -0.5 * P0 + 1.5 * P1 - 1.5 * P2 + 0.5 * P3
C2 = P0 - 2.5 * P1 + 2.0 * P2 - 0.5 * P3
C1 = -0.5 * P0 + 0.5 * P2
C0 = P1




Longer Paths

Linear interpolation & cubic curves generally connect only two points.

Often, we have many points that we want to connect with a single path






Piecewise Interpolation

A longer curve can be broken up into multiple pieces

Each piece is a line or curve connecting 2 points

For a Catmull-Rom curve, use the 4 surrounding points as control points






Piecewise Interpolation

The curve parameter (t) is a measure of how far along we are in the particular segment currently being interpolated

i.e. t=0 at the beginning point (P1)
     t=1 at the end point (P2)






Surfaces

A Bezier patch (surface) can be defined using 16 control points, as a function of 2 parameters.



Where

Creative Commons License
This document is by Dave Pape, and is released under a Creative Commons License.