Model artifacts in XNA from blender

Started by
1 comment, last by watermelonChris 12 years, 2 months ago
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();
}
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).
Are they facing the right way in blender? how do I check?

My 'bowl' is actually made from 1 'polygon/wall'. I'll try make another!

This topic is closed to new replies.

Advertisement