I'm having trouble scaling my model in XNA with C#. The model is bigger than the world itself and I can't seem to scale it down. Below is the code I'm using and an attached screenshot. How can I scale my model down?
private void DrawModel(Matrix currentViewMatrix)
{
Matrix[] bones = animationPlayer.GetSkinTransforms();
// Compute camera matrices.
Matrix view = Matrix.CreateTranslation(0, -40, 0) *
Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
Matrix.CreateLookAt(new Vector3(0, 0, -cameraDistance),
new Vector3(0, 0, 0), Vector3.Up);
float fieldOfView = MathHelper.ToRadians(4);
Matrix projection = Matrix.CreatePerspectiveFieldOfView(fieldOfView, device.Viewport.AspectRatio, 1, 100000);
// Render the skinned mesh.
foreach (ModelMesh mesh in currentModel.Meshes)
{
foreach (SkinnedEffect effect in mesh.Effects)
{
effect.SetBoneTransforms(bones);
effect.View = view;
effect.Projection = projection;
effect.EnableDefaultLighting();
effect.SpecularColor = new Vector3(0.25f);
effect.SpecularPower = 16;
}
mesh.Draw();
}
}
edit: when I change the following lines, I'm able to scale the model, however when I turn my model, it rotates in a circle; the model isn't properly scaled. If I do not scale the model, it turns properly around itself.
How can I fix this?
Matrix view = Matrix.CreateTranslation(0, -50, 0) *
Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
Matrix.CreateLookAt(new Vector3(0, 0, -cameraDistance),
new Vector3(0, 0, 0), Vector3.Up);