
CHAPTER 4 ■ WORKING WITH MODELS
304
myModel = XNAUtils.LoadModelWithBoundingSphere(ref modelTransforms, ➥
"tank", Content);
modelTransforms = AutoScale(myModel, 10.0f);
When it comes to rendering your Model, you can use your normal code, since the
scalinghasbeenstoredintheRootboneofyourModel. This way, each time you call the
Model.CopyAbsoluteBoneTransformsTo method, all resulting matrices will include this scaling
operation, causing all parts of the Model to be scaled before they are rendered to the screen.
Matrix worldMatrix = Matrix.Identity;
myModel.CopyAbsoluteBoneTransformsTo(modelTransforms);
foreach (ModelMesh mesh in myModel.Meshes) ...