neiltrodden
Shawn, I am so glad I saw your response on this thread. I am experiencing a similar problem. I have used the code as given in the XNA documentation to draw the mesh (the How to: Render a model example):
private void DrawModel(Model m)
{
Matrix[] transforms = new Matrix[m.Bones.Count];
float aspectRatio = graphics.GraphicsDevice.Viewport.Width / graphics.GraphicsDevice.Viewport.Height;
m.CopyAbsoluteBoneTransformsTo(transforms);
Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f);
Matrix view = Matrix.CreateLookAt(new Vector3(0.0f, 50.0f, Zoom), Vector3.Zero, Vector3.Up);
foreach (ModelMesh mesh in m.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.View = view;
effect.Projection = projection;
effect.World = MyWorldRotation * transforms[mesh.ParentBone.Index] * Matrix.CreateTranslation(Position);
}
mesh.Draw();
}
}
The effect I am getting (which is difficult to explain, but I'll try!) is that the meshes that make up the model are being drawn orientated incorrectly. The arms and legs end up the wrong way around, the eyes are stuck somewhere in the back of the head etc. When I rotate the model (as that example allows with the xbox controller) some parts of the model rotate correctly. The chest, for example, rotates as you would expect if someone was spinning around on the spot. The legs however, rotate along the wrong axis and rotate as if the model was back-flipping.
I have already used the example you gave for the flatten transform pipeline processor, and this seems to improve things. The whole model now rotates as one around it's origin but the component meshes are all just one big lump and the model as a whole has lost it's structure.
This is all from a free model of a cartoon character in the prone position in 3ds format, then exported as an fbx but I'm getting it on ever model I have tried which has multiple meshes in.
Thanks for your work on the content pipeline, by the way. For all the goodness in the XNA framework, this one thing has meant that there'll be less people out there having to spend months just drawing a wooden crate while they are learning!