开发者

Smooth Path traversing in C#

开发者 https://www.devze.com 2023-01-15 21:30 出处:网络
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.

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

精彩评论

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

关注公众号