Chapter 7. Toward the 3D World
In the previous chapters, we used examples based on 2D geometrical shapes to explain how the WebGL system works and how it supports the behavior of shaders, transformations such as translation and rotation, animation, and texture mapping. However, the techniques you’ve learned so far can be applied not only to 2D shapes but also to 3D objects. In this chapter you’ll take the first step into the 3D world and explore the implications of moving from 2D to 3D. In particular, you will explore:
• Representing the user’s view into the 3D world
• Controlling the volume of 3D space that is viewed
• Handling foreground and background objects
• Drawing a 3D object (a cube)
All these issues have a significant impact ...