Jump to content
  • Advertisement
Sign in to follow this  

Centering 3d text..

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

Hello. I have an object, and I'm able to dispaly text above the object, using D3DXCreateText, and then transposing the world matrix just above the object. Pretty simple. My problem is that the text is left aligned. I'll try to make a tiny ascii diagram lol.. The 'o' represents where the object is. I have to use '.' for spacers because the forums autoformat the text over to the left side. .....................text appears here .....................o ........I want text to appear here .....................o Any idea how to fix this? My only idea on how to do that would be to find the width of the mesh, devide that by 2, and then shift it over to the left.. Any help would be appreciated. Thanks. Note, I'm billboarding the text so it always faces the correct direction, so that isn't a problem. Adam

Share this post


Link to post
Share on other sites
Advertisement
I'm interested in seeing if you can find another way to solve this problem, but I'm pretty sure you can at least examine the vertex data in the mesh that is returned to you. You can construct a bounding box for the mesh extents, and then with that you have your mesh width.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!