0

Using the master branch of Rajawali I can make my camera rotate around an axis using

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

provided that I have NOT set getCurrentCamera().setLookAt(0,0,0). If I do setLookAt, I get no rotation at all.

Using the 0.9 version the equivalent would seem to be

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

but this doesn't seem to work regardless of setLookAt(). I get no rotation at all. If I change getCamera() for another object the rotation works just as I'd expect.

What am I missing with this? Any help much appreciated.

Thanks.

1 Answer 1

0

I used the RotateAnimation3D for rotate my object in my class with below code in new version of rajawali:

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

and it works for me! I think you should change mObject to get currentCamera() for The desired result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.