Summary

In this chapter, we built a Cardboard Android app from scratch, starting with a new project and adding Java code a little bit at a time. In our first build, we had a stereoscopic view of a triangle that you can see in a Google Cardboard headset.

We then added the model transformation, 3D camera views, perspective and head rotation transformations, and discussed a bit about matrix mathematics. We built a 3D model of a cube, and then created shader programs to use a light source to render the cube with shading. We also animated the cube and added a floor grid. Lastly, we added a feature that highlights the cube when the user is looking at it.

Along the way, we enjoyed good discussions of 3D geometry, OpenGL, shaders, matrix math for 3D perspective viewing, geometric normals, and data buffers for the rendering pipeline. We also started thinking about the ways in which you can abstract common patterns in the code into reusable methods.

In the next chapter, we will take a different approach to stereoscopic rendering using Android layout views to build a useful "virtual lobby" that can be used as a 3D menu system or portal into other worlds.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset