Winston
Winston

Reputation: 1820

Rotate animation on x-axis

I want to rotate my image on x-axis, I tried many alternatives, also tried Rotate3dAnimation and it always rotate on Y axis. I want to do my image as:

question image 1

How can i do it?

Upvotes: 1

Views: 2217

Answers (2)

A Honey Bustard
A Honey Bustard

Reputation: 3493

Old question but no solid answer yet. So :

In case your Image is a view you can use ViewPropertyAnimator (Minimal implementation) like this :

yourImage.animate().rotateX(360);

You can chain together all the methods that you need and customize your animation f.e. :

yourImage.animate()
    .rotateX(360)
    .setDuration(1000)
    .setStartDelay(500)
    .setInterpolator(new AccelerateDecelerateInterpolator);

Check all available methods in the docs. ViewPropertyAnimator is available since API 12.

Upvotes: 1

Carnal
Carnal

Reputation: 22064

You should use android.graphics.Camera.rotateX(degrees);

Upvotes: 1

Related Questions