Ortho mode problem

Started by
1 comment, last by JIMbond21 19 years, 10 months ago
Currently I use the ortho mode setup from nehe, but if I try to do 2d before 3d the 3d stuff, wether it be triangles or whatever doesn''t show up, anyone know about this issue and have a solution? Basically I want to do 2d stuff before 3d stuff.
THX,JAP
Advertisement
The problem is probably with the depth buffer values. You draw 2D, and the Z values get set, and then when you draw the 3D stuff, they''re usually "closer" according the the depth buffer, and thus write over the 2D stuff. One thing you could do, if you insist on doing 2D before 3D, is after drawing all your 2D to the screen, draw it all again, but this time have every single 2D element be at the closest possible Z value, and don''t draw any colors, just the Z value. Then when you draw the 3D, no 3D object is going to be any closer than the 2D that is already there.

I can''t give any functions or code, though. I''m a DirectX only person at the moment. Either way, I''d just suggest drawing 2D after 3D, if at all possible. Why don''t you want to do it that way? (I suppose you have a good reason; I''d just like to hear it.)
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
well, the basis of this problem came from an application im trying to make which will have 4 different viewpoints of 4 rendered quads for a blending test, the app would allow me to change the different blending modes and see the differences in realtime, I wanteda background behind the 4 quads so I could see the deference in each perspective, the 4 view are as follows, front left front, back and back right, this was where the question started, I tried to make an ortho matrix to out the background up first without depth testing and then draw the quads so that they would be in front of the background, but then this issue came up, but I seem to have found a temporary soultion, i just pop on a new matrix and set the patrix mode to modelview matrix and then I''m able to getthe effect I want, thx for the reply though.
THX,JAP

This topic is closed to new replies.

Advertisement