O'Reilly logo

Cardboard VR Projects for Android by Matt Schoen, Jonathan Linowes

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

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 ...

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