I have to confess that I am really confused about the available code and algorithms for 3D spline interpolation. For my application I need a path: given some point, defined in 3D space, I need to interpolate them using a spline function (cubic, bezier, etc...). Research on the internet did not yield me a solution, only more confusion.
This algorithm caught my attention algorithm. It defines some 3D points (using MATLAB):
[X, Y, Z] = meshgrid(x, y, z);
and then calls the MATLAB interpolation function:
s = exp(-sqrt(X.^2 + Y.^2 + Z.^2));
sinterp = interp3(x, y, z, s, 0., 0., 0.)
What is the function s for!? The interpolation clearly just needs three points and that's all. What is this function for?
Since I m a C++ programmer I was trying to use the following alglib library which comes up with some useful functions. But even there 3 points aren't sufficient, I have to invoke a function that I don't know.
In my application the 3D points are scattered randomly in space as follows picture. My problem doesn't presume that I need a function for joining the points. Even if I do need it, I don't know how to define it.
What is wrong in how I am approaching this problem? Am I using the wrong library functions? or am I supposed to have a function for spline generation? If yes, how to do I get this function?
Regards