Summary

I hope you're as excited as I am with what we accomplished here! We built a truly practical Cardboard VR app to view a gallery of regular photos and 360-degree photospheres. The project uses the RenderBox library, as discussed in Chapter 5, RenderBox Engine.

To begin with, we illustrated how photospheres work and viewed one on Cardboard using the RenderBox library without any custom changes. Then, to view a regular photo, we created a Plane component to be used as a virtual projection screen. We wrote new materials and shaders to render images with a frame border.

Next, we defined a new Image class and loaded images from the phone's camera folder into a list, and wrote a method to show the image on the screen Plane, correcting its orientation and aspect ratio. Then, we built a user interface that shows a grid of thumbnail images and lets you select one by gazing at it and clicking on the Cardboard trigger to display the image. The grid is scrollable, which required us to add threading, so the app would not appear to lock up when files are loading. Lastly, we added a couple of bells and whistles to launch the app with the image view intent, toggle the menu grid by tilting the phone vertically, and spherical thumbanils for photospheres.

In the next chapter, we'll build another kind of viewer; this time to view full 3D models in OBJ files.

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

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