Jump to content
  • Advertisement
Sign in to follow this  
watermelonChris

Model artifacts in XNA from blender

This topic is 2344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys I'm getting strange artifacts in my model in xna.

The only thing I think could be causing it is the single walled 'bowl' the monkey is in. But it's effecting the face so I'm not sure.
It seems to be showing 'behind' vertices and hiding the ones infront. A culling issue?
Any ideas?

Heres my draw code:
Matrix[] transforms = new Matrix[monkey.Bones.Count];
float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;
monkey.CopyAbsoluteBoneTransformsTo(transforms);
Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f);
Matrix view = Matrix.CreateLookAt(cameraPosition, cameraView, Vector3.Up);
foreach (ModelMesh mesh in monkey.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.View = view;
effect.Projection = projection;
effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateTranslation(monkeyPosition);
}
mesh.Draw();
}

Share this post


Link to post
Share on other sites
Advertisement
This might seem like an obvious question, but are you certain all your triangles are facing the right way in Blender? Is your bowl made up of 2 sided polygons (where both the front and back of polygons are rendered)?

I could be wrong, but I believe by default XNA uses back-face culling (I never actually tested it in XNA, but it was the norm in DirectX).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!