【问题标题】:Rajawali RotateAnimation3DRajawali 旋转动画3D
【发布时间】:2014-04-12 14:58:15
【问题描述】:

使用 Rajawali 的 master 分支,我可以让我的相机绕轴旋转

mRotateAnimation = new RotateAnimation3D(axis, angle);
mRotateAnimation.setDuration(4000);
mRotateAnimation.setTransformable3D(getCurrentCamera());
mRotateAnimation.setInterpolator(new DecelerateInterpolator(5f));
registerAnimation(mRotateAnimation);
mRotateAnimation.play();

前提是我没有设置 getCurrentCamera().setLookAt(0,0,0)。如果我做 setLookAt,我根本没有旋转。

使用 0.9 版本似乎是等效的

mRotateAnimation = new RotateAnimation3D(axis, angle);
mRotateAnimation.setDuration(4000);
mRotateAnimation.setTransformable3D(getCamera());
mRotateAnimation.setInterpolator(new DecelerateInterpolator(5f));
mRotateAnimation.start();

但这似乎不管 setLookAt() 都行不通。我根本没有旋转。 如果我将 getCamera() 更改为另一个对象,则旋转就像我预期的那样工作。

我错过了什么?非常感谢任何帮助。

谢谢。

【问题讨论】:

    标签: android rajawali


    【解决方案1】:

    我使用 RotateAnimation3D 在新版本的 rajawali 中使用以下代码在我的班级中旋转我的对象:

    mAnim = new RotateAnimation3D(Axis.Y, 360);
    mAnim.setDuration(16000);
    mAnim.setRepeatMode(RepeatMode.INFINITE);
    getCurrentScene().registerAnimation(mAnim);
    mAnim.setTransformable3D(mObject);
    mAnim.play();
    

    它对我有用! 我认为您应该更改 mObject 以获取 currentCamera() 以获得所需的结果

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-12
      • 2010-12-18
      • 2012-12-16
      相关资源
      最近更新 更多