m_pGameFont->DrawTextScaled() not display text in DX8.1

m_pGameFont->DrawTextScaled() not display text in DX8.1

Post by George Varg » Mon, 18 Feb 2002 23:14:25



Hi All!

In DirextX 8.1 sample m_pGameFont->DrawTextScaled() not display the text.

In DX 8.0 working fine.

What's wrong?

Thanks: George Varga

 
 
 

m_pGameFont->DrawTextScaled() not display text in DX8.1

Post by Rich - Microsoft Direct3D M » Tue, 19 Feb 2002 02:31:52


[Please do not mail me a copy of your followup]



Quote:>In DirextX 8.1 sample m_pGameFont->DrawTextScaled() not display the text.

You have the source, so step through the code to find out what's
wrong.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book http://www.xmission.com/~legalize/book/
    Don't Support Spammers!  Boycott Fractal Painter 7!
     http://www.xmission.com/~legalize/spammers.html

 
 
 

m_pGameFont->DrawTextScaled() not display text in DX8.1

Post by Aslak Grinste » Wed, 20 Feb 2002 04:46:51


Here's my simple approach to font rendering....

I use this simple MAXScript to generate fonts:

letters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,:;?!+-/*"
for i=1 to letters.count do
(
    a=substring letters i 1
    t=text size:1 mapCoords:true font:"Arial" steps:1 alignment:1
position:[0,0,0]
    T.Text = A
    t.name=a+"_"+i as string
    convertToMesh T
)

Then i export it to a .3ds file.... This 3ds file is then loaded with my 3ds
parser and each triangle mesh is stored in a hash table. As simple as
that... The only problem is that i dont know how wide each char is.... I
just use the bounding width and it looks ok to me.


Quote:> Hi All!

> In DirextX 8.1 sample m_pGameFont->DrawTextScaled() not display the text.

> In DX 8.0 working fine.

> What's wrong?

> Thanks: George Varga

 
 
 

m_pGameFont->DrawTextScaled() not display text in DX8.1

Post by Rich - Microsoft Direct3D M » Wed, 20 Feb 2002 05:41:09


[Please do not mail me a copy of your followup]



Quote:>I use this simple MAXScript to generate fonts:
> [script to generate text as a mesh omitted]

D3DXCreateText does exactly the same thing and without needing 3DSMax.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book http://www.xmission.com/~legalize/book/
    Don't Support Spammers!  Boycott Fractal Painter 7!
     http://www.xmission.com/~legalize/spammers.html
 
 
 

m_pGameFont->DrawTextScaled() not display text in DX8.1

Post by Aslak Grinste » Wed, 20 Feb 2002 17:59:49


Yup

I suspect this is a no-no on a directx newsgroup, but my approach has the
potential to be windows independent. :-)   Thats why i use it .... Its the
same thing with directx mesh functions. This way i could theoretically swap
to OpenGL or some other 3d-library. It still requires rewriting some code,
but at least all my data files are OS independent.



> [Please do not mail me a copy of your followup]



> >I use this simple MAXScript to generate fonts:
> > [script to generate text as a mesh omitted]

> D3DXCreateText does exactly the same thing and without needing 3DSMax.
> --
> Ask me about my upcoming book on Direct3D from Addison-Wesley!
>   Direct3D Book http://www.xmission.com/~legalize/book/
>     Don't Support Spammers!  Boycott Fractal Painter 7!
>      http://www.xmission.com/~legalize/spammers.html

 
 
 

m_pGameFont->DrawTextScaled() not display text in DX8.1

Post by George Varg » Thu, 21 Feb 2002 02:37:51


OK. I will find what's wrong.
Quote:> >In DirextX 8.1 sample m_pGameFont->DrawTextScaled() not display the text.

> You have the source, so step through the code to find out what's
> wrong.
> --

 
 
 

1. DrawTextScaled() not display text in DirectX 8.1

My question:
---------------

RenderFieryText() not display the text.

Rich - Microsoft Direct3D MVP wrote for me:
-----------------------------------------------------

You have the source, so step through the code to find out what's wrong.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book http://www.xmission.com/~legalize/book/
    Don't Support Spammers!  Boycott Fractal Painter 7!
     http://www.xmission.com/~legalize/spammers.html

My answer:
---------------

1. problem in CD3DFont::DrawTextScaled():

    wrong: FLOAT sy  = (y+1.0f)*vp.Height/2;
    good:   FLOAT sy  = (y-1.0f)*vp.Height/2;

2. problem in CD3DFont::DrawTextScaled():

    wrong: w *= (fXScale*vp.Width)/fLineHeight;
    good:   w *= (fXScale*vp.Height)/fLineHeight;

--
George Varga

2. Software development environment?

3. RenderFieryText() not display in DX8.1 example

4. What's my best option for best video upgrade?

5. How to make displaying text not flicker?

6. Max 5 radiosity

7. Text for curving text with PSP6.+ (not text on a path)

8. TIFF format

9. DIB to DX8 Display

10. No display update in Dx8 program

11. DDraw on Dx8 SDK not working

12. Bringing in text from a text file and displaying it

13. DX8 -> DX9 Shaders