Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Programmed a game in XNA that there are many boxes. If we assume that the box 2 is placed on (0,0,0) and Box 1 is placed on (0,0,1) when I placed a camera on (0,0,3) and looking at -Z direction (looking at the boxes), Unfortunately I will see that the Box 2 is in front of box 1.
as you see this is in correct.
Here is my codes

C#
protected override void Draw(GameTime gameTime)
       {
           GraphicsDevice.Clear(Color.DarkGray);
           spriteBatch.Begin();

           for (int i = 0; i < Box.Count; i++)
               Box[i].Draw(ref graphics);

           spriteBatch.End();

           base.Draw(gameTime);
       }



Would you please help me.
Posted
Updated 6-Mar-15 23:51pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900