I am making models in 3ds max. However when I export them to .fbx format and then input them into XNA, they lose their scaling. It is most likely something to do with not using the transforms from the model correctly.
Is the following code correct using XNA 3.0?
Matrix[] transforms = new Matrix[playerModel.Bones.Count];
playerModel.CopyAbsoluteBoneTransformsTo(transforms);
// Draw the model.
foreach (ModelMesh mesh in playerModel.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.World =
transforms[mesh.ParentBone.Index] *
Matrix.CreateScale(Vector3.One*20) *
Matrix.CreateTranslation(position);
effect.View = view;
effect.Projection = projection;
}
mesh.Draw();
}
It also seems to work if I export it in .obj format, which is probably vertex only format, then import it back into 3ds max and then export it to .fbx for XNA.
Here's an image reference in case you don't understand what I am saying. The left is in XNA and the right in 3ds max.