O'Reilly logo

Android 3.0 Animations by Alex Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating 3D rotations

Now that you've got used to some 3D techniques, it's time to introduce some more technical features of the Android graphics APIs. In this example, we will use matrix math to rotate our jigsaw in the three-dimensional space. But don't worry! The API abstracts the actual mathematics into nice easy concepts.

Using these techniques, we essentially think of the thing we are rotating as a set of coordinates to which we apply a mathematical formula. That formula uses what we call a matrix to create the impression that the view is being moved in three dimensions.

This next example makes use of Rotate3dAnimation from the Android example sources. It is provided under the Apache license, and is a useful illustration of how to do 3D transformations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required