curving through points

BlitzMax Forums/BlitzMax Programming/curving through points

Robert Cummings(Posted 2005) [#1]
Hi there,

I have a list of xy points and I'd like to make an alien spaceship curve through those points without knowing anything other than source, dest and current position.

I also vary the speed so any ideas are welcome!


Matt McFarland(Posted 2005) [#2]
Why not use my Spline Editor? :)


Zenith(Posted 2005) [#3]
curving through pants? oh oh!
parabola!! oldschool way!!

http://mathworld.wolfram.com/Parabola.html

I dont expect you to understand anything on that site, because I can't.


Robert Cummings(Posted 2005) [#4]
I have my own spline editor thanks :) this is for something else, I wanted to avoid splines due to the dynamic nature of what I am doing (I won't have a history).


SSS(Posted 2005) [#5]
you could use quadratic (bezier) interpolation. I mean, it wouldn't be 100% perfect at the boundries between the points but other than that it would work fine and be dynamic. I have some B3D code if you want, or I can show you the maths... but you probably know them already. Just an idea anyway...


Shagwana(Posted 2005) [#6]
If you dont need something perfect, just make the alien thing steer towards the next point, when within a certain range make it go to the next point?


Robert Cummings(Posted 2005) [#7]
Thanks all! I have a solution now.


Ferminho(Posted 2005) [#8]
...Which is to remain secret? :(


Robert Cummings(Posted 2005) [#9]
For all eternity.


rdodson41(Posted 2005) [#10]
If you are doing something with asteroids-ish physics then you could just tell the ship that once it reaches a point, start steering towards the next point and the curves will smooth out.


Robert Cummings(Posted 2005) [#11]
Thats a very good idea. I might try that (my solution wasn't so hot). What are parabolic curves?


Beaker(Posted 2005) [#12]
Use Cubic or Hermite interpolation.


Robert Cummings(Posted 2005) [#13]
I have hermite splines, but what is hermite interpolation? the spline requires 4 steps in all, which I don't have..


Beaker(Posted 2005) [#14]
Do as Shag suggests then. If all you know is the previous and next points that is all you can do.


SSS(Posted 2005) [#15]
Once again, you can make a bezier curve using three points? It's fast aswell.


Matt McFarland(Posted 2006) [#16]
OEJ could you atleast email me your solution? I'm finding bezier curves to be a problem with attack enemy attack runs. I feel I would have more control if I could just place points out and haev them curve along them or behave differently when reaching each point. any ideas?