Friday, 24 September 2010

Invent a new spline

For some reason of another, I had to invent a spline, and not a normal four control point one, but a three control point variant. It had to go through all three points, so a three point Bezier was out. I decided to limit the spline so that the tangent would match the end point difference, like Catmull-Rom splines do.

So, here is my new spline.

P(t) = P0*(1+2t^2-2t) + P1*(1-(2t-1)^2) + P2*(2t^-t)

P(0) == P0
P(0.5) == P1
P(1) == P2

At t=0.5 the tangent has equal slope to (P2-P0)

This should make for a reasonably useful curve.

view in glory:

No comments: