Chapter 6

3D Graphics

This chapter covers how to switch from a 2D environment to a full 3D game, which requires several changes. The Actor transform, including 3D rotations, becomes more complex. In addition, you need to load and draw 3D models. Finally, most 3D games have some type of lighting applied to the scene. The game project for this chapter demonstrates all these 3D techniques.

The Actor Transform in 3D

The representation of the Actor transform you have used so far in this book works for 2D graphics. However, supporting a fully 3D world requires some modification. Most obviously, the position Vector2 becomes Vector3. But this brings up an important question: Which directions are x, y, and z in the world? Most 2D games use a coordinate ...

Get Game Programming in C++: Creating 3D Games, First Edition now with O’Reilly online learning.

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