Sign in to follow this  

drawing quad to specific depth

This topic is 4818 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I'm drawing a fullscreen quad in ortho mode. I'm trying to figure out how to specify the depth of the quad. Do I use glvertex3f(x,y,z)... and z will be the depth? I think I might have to set up the zfar and znear to 1 and 0 respectfully. If I do that, then will be z be the value in the depth buffer? Thanks Robbie

Share this post


Link to post
Share on other sites
Hi,

Generally most specify zfar as 100, 500, 4000 etc. The value of z needs to > znear and < zfar. Else its out of viewing area. You need to specify in negative z values cos the negative z axis is into the screen and positive z values come out of the screen.

Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by mrrolf810p

Hi all,

I'm drawing a fullscreen quad in ortho mode. I'm trying to figure out how to specify the depth of the quad.

Do I use glvertex3f(x,y,z)... and z will be the depth?

I think I might have to set up the zfar and znear to 1 and 0 respectfully. If I do that, then will be z be the value in the depth buffer?

Thanks

Robbie


when u call glOrtho it asks for the znear and zfar values, so when drawing and you specify the z value it'll go into the depth buffer at that value. If you set the near value to 0 then to draw on top of everything specify z as 0 (in the vertex stream), same deal with far. If you just do a 2D stream (x and y) i believe it draws everthing to the far plane.

HTH

Share this post


Link to post
Share on other sites

This topic is 4818 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this