A way to do splines?

Blitz3D Forums/Blitz3D Programming/A way to do splines?

ICECAP(Posted 2006) [#1]
I am trying to find a way of creating spline paths for objects to travel along. I know what I want it to do but my brain just wont compute the maths for me.

In the above diagram there are two red points which I want to travel between. But I want it to distort towards the orange point. So the path I want the green arrow to travel is marked with a blue line.
How would I go about doing this mathmaticly? Or if you really feel like a challenge, a small blitz sample would be nice.
:)

Thanks in advance,
Ian


Shambler(Posted 2006) [#2]
http://www.blitzbasic.com/codearcs/codearcs.php?code=843


ICECAP(Posted 2006) [#3]
Ok i had a look at that, but i see no easy way of making an object travel along that path...

Any suggestions?


puki(Posted 2006) [#4]
I am no good at 3D stuff too so I would cheat here.

You can put 3+ waypoints at the peak (where the orange ball is) and a waypoint at the end position then 'PointEntity' your way through.


DJWoodgate(Posted 2006) [#5]
Something on the archives for bmax, might be useful.

http://www.blitzbasic.com/codearcs/codearcs.php?code=1523


Sweenie(Posted 2006) [#6]
Here is another one called Natural Cubic spline.
In this variant, the curve would travel through the orange point instead of just being affected by it.
http://www.blitzbasic.com/codearcs/codearcs.php?code=1100

Check the drawspline function on how to retrieve the points along the curve.