Joining cubic splines
hi,
is there a way to ''join'' two cubic splines together?
I''m working on a simple terrain engine, such that I''ll divide the data set in to sectors, and each sector is managed appropriately - but I need continuity between the sectors.
Its difficult to explain - but if I draw a cubic spline from points 0->3 and then from 4->7 (or 3->6) then there''s a very noticable ''tear'' in between the curves.
can anyone offer a solution to this?
my curve is defined by (a+b)^3, and the keypoints are the coefficients to the terms found by the binomial expansion.
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>
I''m afraid I''m not familar with cubic splines. You should try 0-3 then 2-5. I would say more, but I''m not sure it would be correct. Here is something I did for something else, but it might give you a few ideas. You should be able to convert a cubic spline to a catmull-rom, bezier or generic cubic form. Certainly with a catmull-rom the correct way to join them is 0-3 then 2-5. As near as I can tell from this book I have here it is also true of cubic splines as well. Well, a Cubic Uniform B-Spline.
Keys to success: Ability, ambition and opportunity.
yeah, there is a way to join splines.
What you need to do is ensure that the first and second derivatives are equal at the joined endpoint. You have the freedom to do this, but others have done the math on this(and I''m too lazy to do so).
What you need to do is ensure that the first and second derivatives are equal at the joined endpoint. You have the freedom to do this, but others have done the math on this(and I''m too lazy to do so).
---New infokeeps brain running;must gas up!
hi,
Thanks for the replies.
I think I''ll go with the joining catmull-rom splines together, I understand that already - the second idea I can work out, but I''m a bit too lazy to try atm!
Jack
Thanks for the replies.
I think I''ll go with the joining catmull-rom splines together, I understand that already - the second idea I can work out, but I''m a bit too lazy to try atm!
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>
Actually, bezier splines (it sounds like you''re working with beziers) are dead simple to line up continuously.
If your control points are 0-3 and 3-6, then just make sure that 2, 3, and 4 lie on a straight line to get geometric continuity.
If you want C1 continuity (ie if you are using the spline as a camera path or similar) then also make sure that the distance from 2 to 3 is the same as the distance from 3 to 4.
"Math is hard" -Barbie
If your control points are 0-3 and 3-6, then just make sure that 2, 3, and 4 lie on a straight line to get geometric continuity.
If you want C1 continuity (ie if you are using the spline as a camera path or similar) then also make sure that the distance from 2 to 3 is the same as the distance from 3 to 4.
"Math is hard" -Barbie
"Math is hard" -Barbie
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement