通过贝塞尔曲线移动物体,结合旋转
我的引擎 (AndEngine) 提供了通过贝塞尔曲线路径移动对象的修改器,只需提供 3 或 4 点坐标即可。
在我的比赛中,我会用确定的三分来移动一些小鸟。然而,它看起来很假,因为鸟总是指向一个方向。
这看起来像是一个数学问题,但我认为我应该在 StackOverflow 上发布而不是 Math Exchange:How to certain therotationangle (in radian or Degree) for the Birds at a time?
My engine (AndEngine) provides the modifier to move an object by Bezier Curve path, just by providing 3 or 4 points co-ordinate.
In my game, I move some birds with determined 3 points. However, it looks fake because the birds always point to a direction.
This looks like a mathematical question, but I think I should post at StackOverflow instead of Math Exchange: How to determine the rotation angle (in radian or degree) for the birds at a time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将取两个点,例如 P1 和 P2,并找到它们之间的角度,然后以该角度旋转您的鸟,
我希望这会对您有所帮助。
You will take two points say P1 and P2 and will find the angle between them and then rotate you bird on that angle
I hope this will help you.
(bezier(path,position + epsilon) - bezier(path,position))/epsilon
怎么样?或者,如果您想要不带 epsilon 的值,请查找贝塞尔曲线的一阶导数。What about
(bezier(path, position + epsilon) - bezier(path, position)) / epsilon
? Or, if you want it without the epsilon, look up the first derivation of a bezier curve.