Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.