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\$

1 Answer 1

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.

\$\endgroup\$
1
  • \$\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
    Commented Nov 28, 2011 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .