O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

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

Adding Rotation

Now that we have a projection matrix configured and a model matrix in place to move our table around, all we need to do is rotate the table so that we’re looking at it from across an angle. We’ll be able to do this with one line of code using a rotation matrix. We haven’t worked with rotations yet, so let’s spend some time to learn more about how these rotations work.

The Direction of Rotation

The first thing we need to figure out is around which axis we need to rotate and by how much. Let’s take another look at Figure 25, Right-handed coordinate system. To figure out how an object would rotate around a given axis, we’ll use the right-hand rule: take your right hand, make a fist, and point your thumb in the direction of the ...

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