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

Integrating Our Changes

The hardest part of this chapter is done. We learned how to build a puck and a mallet out of simple geometric shapes, and we’ve also updated our shaders to reflect the changes. All that’s left is to integrate the changes into AirHockeyRenderer; at the same time, we’ll also learn how to add the concept of a camera by adding a view matrix.

So why would we want to add another matrix? When we first started our air hockey project, we originally didn’t use any matrices at all. We first added an orthographic matrix to adjust for the aspect ratio, and then we switched to a perspective matrix to get a 3D projection. We then added a model matrix to start moving stuff around. A view matrix is really just an extension of a model matrix; ...

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