0
\$\begingroup\$

I'm trying to render a model made in Blender. I export it to .fbx and import it in the content pipeline, load and draw it, but it displays like this:

enter image description here

And this is what it looks like in Blender:

enter image description here

Code that draws the model:

foreach (ModelMesh modelMesh in model.Meshes)
{
    foreach (BasicEffect basicEffect in modelMesh.Effects)
    {
        basicEffect.EnableDefaultLighting();
        basicEffect.PreferPerPixelLighting = true;
        basicEffect.World = Matrix.CreateTranslation(Position);
        basicEffect.View = camera.ViewMatrix;
        basicEffect.Projection = Matrix.CreatePerspectiveFieldOfView(width / height, MathHelper.PiOver2, 0.1f, 100f);
    }

    modelMesh.Draw();
}

Does anyone know what's wrong with the model?

\$\endgroup\$
7
  • \$\begingroup\$ Looks like you're not using the depth buffer — either not reading it, or not writing to it. \$\endgroup\$ Commented Aug 8, 2019 at 11:15
  • \$\begingroup\$ I don't know what that is. Is that in MonoGame or Blender? \$\endgroup\$ Commented Aug 8, 2019 at 11:17
  • \$\begingroup\$ Did you search the term to find out? Don't underestimate your ability to find your own answers! This previous user experienced similar symptoms due to how they configured their camera — putting the near plane too close to the camera and the far plane too far, so there wasn't enough depth resolution to correctly sort scene fragments at typical view distances. \$\endgroup\$ Commented Aug 8, 2019 at 11:22
  • \$\begingroup\$ Yeah, I was having a look and I saw some stuff about the near and far clip planes and now I understand them even less. Setting the near to 1 didn't help. \$\endgroup\$ Commented Aug 8, 2019 at 11:24
  • \$\begingroup\$ Maybe you should show us your current settings then. \$\endgroup\$ Commented Aug 8, 2019 at 11:25

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.