• Advertisement
Sign in to follow this  

Projecting 3D coordinates to 2D for text drawing

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

I'm trying to draw text on screen using ID3DXFont but this only takes 2D coordinates. So far I've got:
	D3DXMATRIX n = viewmatrix * projectionmatrix;

	D3DXMATRIX textposition3d;
	D3DXMatrixIdentity(&textposition3d);
	D3DXMatrixTranslation(&textposition3d, 6.0f, 0.0f, 0.0f);

	D3DXMATRIX textposition2d = textposition3d * n;

	r->rendertext(L"text on screen", <x coordinate>, <y coordinate>);
I'm not sure whether this is the correct way to go about it and I also have no idea how to extract the coordinates from the textposition2d matrix. Any help would be appreciated :)

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement