Jump to content
  • Advertisement
Sign in to follow this  
oliver_mpt

Text and ZBuffer

This topic is 3154 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 again, Does anyone know if it's possible to play with the z ordering of ID3DXFont objects to hide some behind objects ? I have made a few test but I'm unable to move the text at different depths. I can't play with 3D objects overlapping the text. Oliver

Share this post


Link to post
Share on other sites
Advertisement
ID3DXFont uses ID3DXSprite which uses an orthographic projection matrix by default, so the Z values won't match up, which would make the Z values from one projection space meaningless in the other.

You could however use the D3DXSPRITE_OBJECTSPACE flag to ID3DXSprite::Begin (Which is the sprite you'll need to pass to ID3DXFont), but then you'll need to make sure you use a transform which won't scale the text - which could be tricky.

Share this post


Link to post
Share on other sites
Try changing the viewport's Z range to limit the range to which Z values are transformed. That should be an easy way to control this.

Using the sprite's transform may not be too difficult. I'd assume that changing the translation's Z and leaving everything else the same would work.

Note that as Steve says, these Z values are not the world's Z values, but if you transform your objects using world/view/projection you should get the relevant values.

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!