First, sorry for my english.
I’m trying to draw a serie of Model objets and, at the same time, draw 2D images for create an UI.
Whitout code for draw 2D images, 3D models looks fine but when i try to introduce code for draw one image, 3D looks but very bad, without textures, only the color of textures and looks any faces of back side of models.
My code:
(part of class Game1)
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.SkyBlue);
switch (phaseRunningNow)
{
case "partida":
partida1.Draw();
break;
case "mainMenu":
break;
}
// Only this 3 lines are for 2D
spriteBatch.Begin();
spriteBatch.Draw(ImageStorage.GetImage(gandalf.GetNameOfImage()), gandalf.GetPosition(), Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
(part of class Partida)
public void Draw()
{
for (int i = 0; i < colisionableStaticSprites.Count; i++)
colisionableStaticSprites[i].Draw(camera1.GetViewMatrix(), camera1.GetProjectionMatrix(), ModelStorage.GetModel(colisionableStaticSprites[i].GetNameOfModel()));
}
Thanks for your time.