Java3d:移动相机和动画
在我的游戏中,我在 KeyBehavior 中移动相机(扩展 ViewPlatformBehavior) 这工作正常,但我希望能够以更流畅的方式移动相机。目前这些动作的长度约为 1 米,看起来像一个“台阶”。知道如何让相机在两个向量之间移动动画吗?
protected void doMove(Vector3f theMove) {
// move the main, forward-facing camera
// get the current location and translate it by the passed in Vector.
targetTG.getTransform(t3d);
toMove.setTranslation(theMove);
t3d.mul(toMove);
targetTG.setTransform(t3d);
}
In my game I move the camera in my KeyBehavior (extends ViewPlatformBehavior) This works fine but I'd like to be able to move the camera in a more fluid way. Currently these moves are about 1 meter each and look like a "step". Any idea how to animate the camera move between the 2 vectors?
protected void doMove(Vector3f theMove) {
// move the main, forward-facing camera
// get the current location and translate it by the passed in Vector.
targetTG.getTransform(t3d);
toMove.setTranslation(theMove);
t3d.mul(toMove);
targetTG.setTransform(t3d);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决这个问题,我使用了一个转换向量并在循环中移动相机转换。工作正常。 :)
To solve this I used a transtion Vector and moved the Camera transform in a loop. Works fine. :)