I have a list of line segments that go through a track model and I am looking to achieve two things:
- smooth the general shape of the path
- be able to evaluate a position by questioning
I've implemented the Catmull-Rom spline using the
TreeSpline Unity class (this is not explicitly mentioned in the documentation but you can see it here), it works except for one thing: some places have an overtaking:
- purple: line segments of origin
- white: result of the
After looking a little, it seems that monotonous cubic interpolation would be a solution to my problem. However, formulas only show how to use 2D points, not 3D points that I use.
How can I adapt Wikipedia article formulas to 3D points?
(I am also open to alternative approaches)
Thanks to @Jay, it's better now: