Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem at the moment when I draw some models to teach me more about 3D game programming. The models at the moment overlaps each other from some angles witch makes sense since the game at the moment draws from left to right, line after line.

However my question is: Is there any easy escape from this issue or is there any way that you could draw the in-game world from the players position?

I would really appreciate if someone could give me some answers on this.

share|improve this question
up vote 4 down vote accepted

Without seeing any screenshots, I'm pretty sure you have depth testing disabled, so the last drawn model is the one that appears on top of the others, even if it is the furthest in the scene. To fix this, set GraphicsDevice.DepthStencilState = DepthStencilState.Default before drawing your models.

share|improve this answer
Lovely worked right away! Thank you very much. Kinda bothers me though that it was such a thing that I missed. Thank you once more you've made my day! :) – Auren Nov 28 '11 at 9:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.