#111010 - simonjhall - Sun Dec 03, 2006 4:51 pm
I don't want to have any perspective correction or anything when rendering my graphics so I've been using
to get my stuff on the screen. It's all fitting on the screen just fine but there's *nothing* that I can do to get Z-testing to work.
If I just draw two triangles and play with the z co-ords of the vertices the triangle which is drawn last is always drawn on top. This goes for any value of z-near and z-far. In fact if I change the z of the vertices to be behind the camera they'll still be drawn!
If I replace the ortho call with
everything looks perfectly fine and triangles come out in the proper depth order. The perspective projection makes stuff look slightly wrong though.
Am I missing something here?
_________________
Big thanks to everyone who donated for Quake2
Code: |
glOrtho(-6, 5, 3.5f, -4.5, 1.0f, 0x7fff); |
to get my stuff on the screen. It's all fitting on the screen just fine but there's *nothing* that I can do to get Z-testing to work.
If I just draw two triangles and play with the z co-ords of the vertices the triangle which is drawn last is always drawn on top. This goes for any value of z-near and z-far. In fact if I change the z of the vertices to be behind the camera they'll still be drawn!
If I replace the ortho call with
Code: |
gluPerspective(35, 256.0 / 192.0, 1.0f, 0x7fff); |
everything looks perfectly fine and triangles come out in the proper depth order. The perspective projection makes stuff look slightly wrong though.
Am I missing something here?
_________________
Big thanks to everyone who donated for Quake2