Sivan showed me a nice algorithm for a spline called catmull rom spline. It is implemented in DX and easy to use as you can see here:
http://www.mvps.org/directx/articles/catmull/The function looks like:
D3DXVec3CatmullRom(D3DXVECTOR3* pOut,
CONST D3DXVECTOR3* pV1,
CONST D3DXVECTOR3* pV2,
CONST D3DXVECTOR3* pV3,
CONST D3DXVECTOR3* pV4,
FLOAT s)
As s, I pass values from 0 to 1 in steps of 0.1
My problem is that when I define a spline, it only goes 2/3 of the entire path as you can see in this image (blue is the path, red is the spline):
Any ideas?