Chapter 7. Your First VR Application

In previous chapters, we learned the basic techniques of virtual reality development. We also surveyed various VR platforms coming to market, as well as the popular tools used to create VR. In this final chapter, we are going to put this all together and create an end-to-end application.

Given the time and space constraints of a book, we can’t really build a production-quality app; but we can go through, in fine detail, the steps required to create a meaningful VR experience with simple user interaction. For the exercise, we will focus on an app that is immediately understandable by everyone: a panoramic photo viewer for smartphones, using Google Cardboard VR.

Figure 7-1 shows a screenshot from my Nexus 5: a 360-degree panoramic photo of Yosemite National Park, rendered side by side for Cardboard. At the bottom of the screen are four semitransparent image thumbnails. Gazing over any thumbnail makes it turn opaque (i.e., “selects” it); touching the magnet switch on the side of the Cardboard viewer will change the panorama to the selected image. This is what we are going to build.

Recall that, when developing for Cardboard, we have several choices of tools and languages. We can use Unity3D, currently the most popular VR development environment; we can go with Java-based native Android development, via the Android Studio IDE; or we can write web code for mobile browsers, using a JavaScript-based VR framework such as Three.js. In the end, I decided ...

Get Learning Virtual Reality now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.