Jump to content
  • Advertisement
Sign in to follow this  
mrrolf810p

drawing quad to specific depth

This topic is 5035 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!