Summary

In this chapter, we created a short and sweet, lightweight graphics engine to build new Cardboard VR applications. We abstracted the low-level OpenGL ES API calls into a suite of Material classes and a Camera class. We defined RenderObject for geometric entities, a Camera and Light components which inherit from a Component class. We defined a Transform class to organize and orient entities (which contain components) hierarchically in 3D space. All of this is integrated under the RenderBox class, which is instantiated and controlled in the MainActivity class, which, in turn, implements the IRenderBox interface. We complete the circle by specifying the MainActivity class as the implementer of IRenderBox and implementing setup, preDraw, and postDraw.

To develop the library, we followed much of what was covered in Chapter 3, Cardboard Box, with less explanation of how to use OpenGL ES and matrix libraries and more focus on implementing our RenderBox software architecture.

The resulting RenderBox engine library is now in its own project. In subsequent chapters we will reuse this library, and we will expand it, including new Components and Materials. You are encouraged to maintain your RenderBoxLib code in a source code repository, such as Git. Of course, the final code is provided with the book assets and in our GitHub repository.

The next chapter is a science project! We're going to build a model of our Solar System, replete with the Sun, planets, moons, and a starscape. Using RenderBox, we will add a Sphere component, and we will also add textured shaders to our suite of materials.

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

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