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

Manipulating the Tanks

Remember earlier when you were looking at the new frame class? Two sets of matrices were being stored, the transformation matrix and the combined matrix. However, they were never actually set to anything, so how are they supposed to work? Well, the transformation matrices are actually set by the runtime, after the model is loaded. It knows, for example, that the tank's gun turret should sit just above the tank's body, and it sets the transformation matrix to make this happen. The combined transformation matrix, however, is something you've added that the runtime knows nothing about. Look at the Update method in Listing 13.8 and add it to your tank class.

Listing 13.8. Updating the Tank
 /// <summary> /// Update the tank ...

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