views:

90

answers:

3

Hello.
I'm looking for a C# implementation of a Spline, not to draw it, but to traverse it.
Basically I have a 2D game and I want an object to move on a predefined path.
Any ideas how to implement this ?
Thanks,
SW

+1  A: 

Have a look at some equations on how to interpolate splines: http://en.wikipedia.org/wiki/Spline_interpolation

This may also help: http://stackoverflow.com/questions/1879179/calculate-a-bezier-spline-to-get-from-point-to-point

Blam
A: 

When I had to do this for a game years ago, I implemented a form of parametric spline curve that was simple to build and required little in the way of CPU resources. What I built is similar to what's in the linked article. One really nice thing about this type of spline is that the math is not at all advanced.

Unfortunately, I don't have access to the C source code for my implementation.

Jim Mischel
A: 

Also check out Numerical Recipes, and netlib.org.

Jess