7. Toward the 3D world

Chapter Overview:

This chapter takes the first step into the 3D world and explores the implications of

moving from 2D to 3D. In particular, you will explore: (1) representing the user’s view

into the 3D world; (2) how to control the volume of 3D space that is viewed; (3) clipping;

(4) foreground and background objects; and (5) drawing a 3D object—a cube. All these

issues have a significant impact on how the 3D scene is drawn and presented to viewers.

A mastery of them is critical to building compelling 3D scenes.

1. LookAtTriangles

2. LookAtRotatedTriangles

3. LookAtRotatedTriangles_mvMatrix

4. LookAtTrianglesWithKeys

5. OrthoView

6. LookAtTrianglesWithKeys_ViewVolume

7. OrthoView_halfSize

8. OrthoView_halfWidth

9. PerspectiveView

10. PerspectiveView_mvp

11. PerspectiveView_mvpMatrix

12. DepthBuffer

13. Zfighting

14. HelloCube

15. ColoredCube

16. ColoredCube_singleColor