Knot Insertion on cubic hermite spline

Started by
1 comment, last by cadjunkie 10 years, 6 months ago

Hi,

I am trying to mimic Maya's Graph Editior and I am using cubic hermite spline to interpolate between 2 points based off tangents that the user can manipulate manually. It looks okay but when I insert a point, the position of this new point appears to be correct but the new interpolation causes the spline to change shape. Anyone have any ideas?

Here is the algorithm I am using:

4406b914f905dc0946585e1527951e21.png

and I am using the derivative of this to calculate the slope of this new point.

Thanks!

Advertisement

You may want to trying switching to a cubic Bezier curve and using de Casteljau's algorithm.

-Josh

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet

As you spline together more points, you're redefining the spline because it's trying to keep C1 continuity. The curve should change somewhat, but the curve should pass through the defined points. Post a picture and we can debug from there.

As jjd stated, you can use Bezier curves and achieve the same effect. The cubic Hermite spline on the unit interval is basically another form of a Bezier curve. The only difference is that instead of specifying Bezier control points, you're specifying endpoints and tangents. Bezier curves are easier to implement and debug, plus they give you way more control than cubic Hermite splines. I don't know if you want to give the user more control to achieve C0, C1, and C2 continuity, but it's something to think about.

This topic is closed to new replies.

Advertisement