Skip to main content
gamedev.net
🔒 Locked

D3D Font class

Started by BeRSeRKeR[DGT] Jun 22, 2000 at 6:35 AM 1 replies 450+ views
Original Post
BeRSeRKeR[DGT]
BeRSeRKeR[DGT]
Hi all. I''m trying to port a font class from OpenGL to D3D, but I''m having some problems. The text strings must be projected with an orthogonal projection matrix...How can I create one with D3D?. OpenGL makes one with glOrtho function but D3D... Thank you.
Gandalf
Gandalf
I don´t know but one thing you can try is to set both dvMinZ and dvMaxZ (D3DVIEWPORT7 structure members) to 0 to force the system to render objects to the foreground.

Gandalf the White

Gandalf the Black
Shinkage
Shinkage
If you don''t need to draw the text in world space, couldn''t you just use screen space coordinates? This would bypass any projection at all and allow you to specify the coordinates of the text directly on the screen (check out D3DTLVERTEX structure).

Otherwise, you''ll need to set the projection matrix in Direct3D''s transformation pipeline. D3DX can be used to make setting up the matrix a whole lot simpler...

D3DXMATRIX matrix;
D3DXMatrixOrtho( &matrix, view_width, view_height, 1.0f, 100.0f );
device->SetTransform( D3DTRANSFORMSTATE_PROJECTION, matrix );

Look the functions up in the DirectX help file if you need more information.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.