开发者

Smooth Path traversing in C#

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,

SW


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜