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 i开发者_如何学Pythonmplement this ? Thanks, SWHave a look at some equations on how to interpolate splines: http://en.wikipedia.org/wiki/Spline_interpolation
This may also help: Calculate a bezier spline to get from point to point
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.
Also check out Numerical Recipes, and netlib.org.
精彩评论