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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.