• Create Account

# Knot Insertion on cubic hermite spline

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1llamagod  Members   -  Reputation: 102

Like
0Likes
Like

Posted 21 September 2013 - 04:35 PM

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:

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

Thanks!

### #2jjd  Crossbones+   -  Reputation: 1338

Like
0Likes
Like

Posted 22 September 2013 - 02:27 PM

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

-Josh

### #3cadjunkie  Members   -  Reputation: 779

Like
0Likes
Like

Posted 24 September 2013 - 12:16 PM

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.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS