What we'll cover in this chapter:
The Matrix class
In this chapter, I'm not necessarily going to introduce any new types of motion or physics or methods of rendering graphics. What I am going to do is give you an introduction to matrices, which provide an alternative way of doing a lot of the things you've already been doing.
Matrices are used quite often in 3D systems for rotating, scaling, and translating (moving) 3D points. They are also used quite a bit in various 2D graphics transformations. You might recall that the
beginGradientFill method uses a matrix to position, size, and rotate the gradient.
In this chapter, you'll see how to create a system of 3D matrices to manipulate sprites in 3D ...