I have gone through a few posts that talks about changing the GraphicsDevice.BlendState and GraphicsDevice.DepthStencilState (SpriteBatch & Render states). . however even after changing the states .. i cant see my 3D model on the screen.. I see the model for a second before i draw my video in the background. . Here is the code:
case GameState.InGame:
GraphicsDevice.Clear(Color.AliceBlue);
spriteBatch.Begin();
if (player.State != MediaState.Stopped)
{
videoTexture = player.GetTexture();
}
Rectangle screen = new Rectangle(GraphicsDevice.Viewport.X, GraphicsDevice.Viewport.Y, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
// Draw the video, if we have a texture to draw.
if (videoTexture != null)
{
spriteBatch.Draw(videoTexture, screen, Color.White);
if (Selected_underwater == true)
{
spriteBatch.DrawString(font, "MaxX , MaxY" + maxWidth + "," + maxHeight, new Vector2(400, 10), Color.Red);
spriteBatch.Draw(kinectRGBVideo, new Rectangle(0, 0, 100, 100), Color.White);
spriteBatch.Draw(butterfly, handPosition, Color.White);
foreach (AnimatedSprite a in aSprites)
{
a.Draw(spriteBatch);
}
}
if(Selected_planet == true)
{
spriteBatch.Draw(kinectRGBVideo, new Rectangle(0, 0, 100, 100), Color.White);
spriteBatch.Draw(butterfly, handPosition, Color.White);
spriteBatch.Draw(videoTexture,screen,Color.White);
GraphicsDevice.BlendState = BlendState.Opaque;
GraphicsDevice.DepthStencilState = DepthStencilState.Default;
GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;
foreach (_3DModel m in Solar)
{
m.DrawModel();
}
}
spriteBatch.End();
break;