O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Vectors

You've seen vectors already within this book, and it's possible you think that they are simply a representation of a point in space, such as a vertex. Although it's true that the vector can store this information, it does so in the DirectX API mainly for a convenience. The mathematical definition of a vector is an object that denotes both direction and velocity (or magnitude). For example, if you fire a bullet out of a tank (for which you will write code in the next game), that bullet has both a direction and a velocity. They are stored in one vector, which incidentally has the same members as a vertex, namely x, y, and z components. You're probably thinking, wait, how can you specify these two things with a single set of three coordinates? ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required