Jump to content
  • Advertisement
Sign in to follow this  
llamagod

Knot Insertion on cubic hermite spline

This topic is 2126 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!