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; ...
Get OpenGL ES 2 for Android now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.