curving through points

BlitzMax Forums/BlitzMax Programming/curving through points

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!

Why not use my Spline Editor? :)

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.

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).

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...

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?

Thanks all! I have a solution now.

...Which is to remain secret? :(

For all eternity.

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.

Thats a very good idea. I might try that (my solution wasn't so hot). What are parabolic curves?

Use Cubic or Hermite interpolation.

I have hermite splines, but what is hermite interpolation? the spline requires 4 steps in all, which I don't have..

Do as Shag suggests then. If all you know is the previous and next points that is all you can do.

Once again, you can make a bezier curve using three points? It's fast aswell.

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?