I am trying to draw a 3D model I made with Blender in Monogame/XNA and this is the result I get when I draw 2 of them on top of each other
How can I make it so that the colors don't add up, but the one covers the other ? Here is my drawing code:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);
Vector3 modelPosition = new Vector3(-2500, 1500.0f, 0.0f);
Vector3 cameraPosition = new Vector3(0.0f, 0.0f, 5000.0f);
float aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width /
(float)graphics.GraphicsDevice.Viewport.Height;
Vector3 scale = new Vector3(1f, 1, 1);
Matrix[] transforms = new Matrix[Brick.Bones.Count];
Brick.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in Brick.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[mesh.ParentBone.Index]*Matrix.CreateScale(scale)*
Matrix.CreateRotationY(modelRotation)*Matrix.CreateTranslation(modelPosition);
effect.View = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up);
effect.Projection = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f);
}
mesh.Draw();
}
base.Draw(gameTime);
}