Jump to content
  • Advertisement
Sign in to follow this  
Hadzz

XNA Models Help

This topic is 2119 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

Okay so I'm making an XNA game for my senior project, and everything is going okay except for one little annoying thing. I'm using Blender to make the models and it works pretty good. But for the wall models I make, I have 4 faces on the front so i could tile the texture to make the bricks look a little smaller. When viewing from the front, everything looks fine, but when you look at it from the side, a fairly thick black seam appears.

Front View:
2012-09-29_1243_zpse51022c0.png

Side View:
2012-09-29_1242_zps208b07da.png

Wall With More Faces (Side View):
2012-09-29_1252_zps7481f79f.png

Draw method (second part is drawing a bounding box when its selected):
[source lang="csharp"]public void Draw()
{
if (!drawObject)
return;
// Copy any parent transforms
Matrix[] transforms = new Matrix[Model.Bones.Count];
Model.CopyAbsoluteBoneTransformsTo(transforms);
GameEngine.Graphics.DepthStencilState = DepthStencilState.Default;

// Loop for each mesh in the model
foreach (ModelMesh mesh in Model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.LightingEnabled = false;
effect.World = transforms[mesh.ParentBone.Index] * World;
effect.View = GameEngine.View;
effect.Projection = GameEngine.Projection;
}
mesh.Draw();
}
if (selected && hasBoundingBox)
{
GameEngine.Graphics.DepthStencilState = DepthStencilState.Default;

effect.View = GameEngine.View;
effect.Projection = GameEngine.Projection;
effect.CurrentTechnique.Passes[0].Apply();
{
GameEngine.Graphics.DrawUserPrimitives(PrimitiveType.LineList, vertexData, 0, 12);
}
}
}[/source]

Has anyone else run into this? Any ideas on how to fix this?
Any help is much appreciated.

Share this post


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