Xna model parts are overlying others

Posted by Federico Chiaravalli on Game Development See other posts from Game Development or by Federico Chiaravalli
Published on 2012-09-23T16:02:54Z Indexed on 2012/09/23 21:50 UTC
Read the original article Hit count: 351

Filed under:
|
|
|

I am trying to import in XNA an .fbx model exported with blender.

Here is my drawing code

public void Draw()
{
    Matrix[] modelTransforms = new Matrix[Model.Bones.Count];
    Model.CopyAbsoluteBoneTransformsTo(modelTransforms);

    foreach (ModelMesh mesh in Model.Meshes)
    {
        foreach (BasicEffect be in mesh.Effects)
        {
            be.EnableDefaultLighting();
            be.World = modelTransforms[mesh.ParentBone.Index] * GameCamera.World * Translation;
            be.View = GameCamera.View;
            be.Projection = GameCamera.Projection;
        }
        mesh.Draw();
    }
}

The problem is that when I start the game some model parts are overlying others instead of being behind. I've tried to download other models from internet but they have the same problem.

© Game Development or respective owner

Related posts about c#

Related posts about xna-4.0