4
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ 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! :) \$\endgroup\$ – Auren Nov 28 '11 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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