This is a noob question but I've searched extensively and cannot find the answer.
I've got two separate meshes that need to be drawn in the same window, both using DrawUserIndexedPrimitives. I'm using two BasicEffect instances with their own view & projection matrices.
However when these are rendered there's a line joining the two together. XNA thinks they're part of the same mesh. Do I need to use a separate GraphicsDeviceManager instance for each one? That does not seem right..
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
GraphicsDevice.VertexDeclaration = declaration;
effect.Begin();
effect.View = view;
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(PrimitiveType.TriangleList, positions1, 0, positions1.Length, index1, 0, index1.Length / 3);
pass.End();
}
effect.End();
effect2.Begin();
effect2.View = view2;
foreach (EffectPass pass in effect2.CurrentTechnique.Passes)
{
pass.Begin();
GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(PrimitiveType.TriangleList, positions2, 0, positions2.Length, index2, 0, index2.Length / 3);
pass.End();
}
effect2.End();
base.Draw(gameTime);
}
The last triangle in positions1 is joined to the first in positions2.
Thanks for any help you can give..