Jump to content
  • Advertisement
Sign in to follow this  
PdG

Bitmap Fonts, reprise

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

So: i've choosed this way: 1) save a big texture with all the chars drawed on it. 2) prepare a quad (4 vertex, 2 triangles) 3) choose uv coords for the quad to display only the char to display 4) draw the quad, then goto 3 for the next char of the string. Ok, now a "simple" question: the quad has 3d coords, the font are in 2d, and i want a) display the font always "in front" of the camera, not rotated. I want that it looks like 2D font. Pheraps i've to use the billboarding approach? b) pheraps it's better to use 2D coords for me. If i want to draw something on screen, is more natural to use the (0,0) - (screen width, screen height) coords. Is there any esay way to convert the 2D coords into 3d coords, taking on input also the camera position? c) if i use 3d world to write some chars some object, due to the z-buffer, could be "in front of", and obscure the chars. I don't want it, i want the chars always displayed: it's a hud. d) i need to find the exact scale factor to display the quad at the right dimension that corrispond one pixel of texture= one pixel of quad. If the quad is too big, the texture will be blurred, and if it's too small, the texture of the char will be too small and unreadable. Any suggestion? Looking to these problembs i suspect that there should be some more easy way to display 2D data into a 3d device. I think that use a 3d engine to display 2d data (chars, icons and so on) is like use photoshop to create a white jpg. DirectDraw are no more included in directx so.. explain me please :)

Share this post


Link to post
Share on other sites
Advertisement
it can be done in may ways, but the way I think it's the best is to set an ortogonal projection matrix, or better, a hand crafted projection matrix without any perspective, that will tranform ( x, y, 0.5) 3D values into 2D viewport values.

Share this post


Link to post
Share on other sites
Quote:
Original post by vicviper
it can be done in may ways, but the way I think it's the best is to set an ortogonal projection matrix, or better, a hand crafted projection matrix without any perspective, that will tranform ( x, y, 0.5) 3D values into 2D viewport values.


I'm not an 3d math superhero :), please can give me a little example?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!