Sign in to follow this  
watermelonChris

Model artifacts in XNA from blender

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:
[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();
}[/code]

Share this post


Link to post
Share on other sites
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this