Sign in to follow this  

Text and ZBuffer

This topic is 2847 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
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

This topic is 2847 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