Archived

This topic is now archived and is closed to further replies.

JIMbond21

Ortho mode problem

Recommended Posts

JIMbond21    122
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.

Share this post


Link to post
Share on other sites
Agony    3452
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.)

Share this post


Link to post
Share on other sites
JIMbond21    122
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.

Share this post


Link to post
Share on other sites