
CHAPTER 4 ■ WORKING WITH MODELS
295
worldMatrix = Matrix.CreateTranslation(position);
worldMatrix = Matrix.CreateRotationY(angle) * worldMatrix;
worldMatrix = Matrix.CreateScale(0.005f) * worldMatrix;
In this case, first the coordinate system of the model is moved toward the final 3D position
of the center of the model. Next, the Y rotation of this recipe is applied, rotating the coordinate
system. After this, it shrinks. Because this is a scaling matrix, it can be swapped from place
with the adjacent Y rotation matrix, not with the translation matrix (see recipe 4-2).
As a result, the Model will be moved to its location, rotated, and shrunk afterward. ...