-1
\$\begingroup\$

I have a couple of Models here, but there's only one, which will always draw in front of the others.

I tried to replace the asset-source to an other model and then the order is correct, but on this particular one, it won't render behind the other model like it should.

See the problem here (Problematic model is the dark mountain)

http://s1.postimg.org/d92ku9mvh/image.png

Why is that happening?

\$\endgroup\$
1
  • 3
    \$\begingroup\$ You should probably post some code. Until you do, it's just a guessing game about what's wrong with your particular method. \$\endgroup\$ Apr 24, 2013 at 20:18

4 Answers 4

1
\$\begingroup\$

Make sure that the winding order is correct for this model. Try drawing the asset with an opposite winding.

\$\endgroup\$
0
0
\$\begingroup\$

I haven't wrote anything in XNA for a long time, but I think one of those XNA settings should solve your problem

 rs = new RasterizerState();
 rs.CullMode = CullMode.None;
 Device.RasterizerState=rs;

or

 Device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.AliceBlue, 1.0f,0);
 Device.DepthStencilState = DepthStencilState.Default;
\$\endgroup\$
1
  • \$\begingroup\$ I wrote that into the main Game-Class' init method. Didn't work :/ \$\endgroup\$
    – IMX
    Apr 25, 2013 at 0:05
0
\$\begingroup\$

Seeing as how it works correctly when using another model, have you check the file to make sure the vertices are in the correct place? Can you rotate the view around to see if the model is physically in-front of the models or if it's just rendering weirdly?

\$\endgroup\$
1
  • \$\begingroup\$ I've rotated it. Shows correctly but still draws not in order \$\endgroup\$
    – IMX
    Apr 25, 2013 at 0:10
0
\$\begingroup\$

The problem was the Z-Axis.

The model had an immense length regarding the Z-Axis, so that it seemed "always not drawed in order"

So solution: Decrease length in Z-Axis

\$\endgroup\$

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