# DX11 Need help with Rastertek tutorial - making a 2D font overlay

## Recommended Posts

Hi guys, anyone experienced with DX11 could look at my graphics.cpp class? I got fonts rendering correctly

with painters algorithm - painting over the other 3d stuff each frame, however, whenever I turn the camera left or right,

the fonts get smushed narrower and narrower, then disappear completely.

It seems like the fix must be a very small change, untying their rendering from the cam direction,

but I just can't figure out how to do it under all this rendering complexity. Any tips would be helpful, thanks.

Edited by mister345

##### Share on other sites

When displaying text, you are not suppose to use the viewMatrix. Only the orthoProjection is needed but I think in this tutorial you will also need the basic world Matrix. The problem is that you are storing rotation inside your viewMatrix or any other type of modelMatrix and this cause to rotate your quad containing your text. It produces your bad effects, get narrow ...

Hope it helps

Edited by Thibault Ober

##### Share on other sites
On 11/12/2017 at 10:20 PM, Thibault Ober said:

When displaying text, you are not suppose to use the viewMatrix. Only the orthoProjection is needed but I think in this tutorial you will also need the basic world Matrix. The problem is that you are storing rotation inside your viewMatrix or any other type of modelMatrix and this cause to rotate your quad containing your text. It produces your bad effects, get narrow ...

Hope it helps

So you're saying in the following function, dont pass in the view matrix right? What matrix should I pass in instead, just identity?

SetShaderParameters(deviceContext, worldMatrix, identity /*viewMatrix*/, projectionMatrix, texture);

##### Share on other sites

I don't know how you handle your mouse. But you should put the resulting rotation somewhere (in a matrix). In order to draw your quad properly (in front) you shouldn't try to use them.

I will recommend to take in to account only the orthoProjection Matrix you have.

SetShaderParameters(deviceContext, identity, identity /*viewMatrix*/, projectionMatrix, texture);

projectionMatrix i think is computed with an orthoProjection. Try the code above and tell us your result.

good luck

Edited by Thibault Ober

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628375
• Total Posts
2982310
• ### Similar Content

• By potente
Hello everyone.
I have [digital] modeling from Vaughan, dance music manual from Snowman, is it there anything similar for 2D graphics?
Thanks in advance for any help.

Bye, Ivano.

• I need some help determining which methods of path finding i should use. The scenario is that i want 100-1000 agents (with steering behaviors) moving to a single location (the player) via a flow field. I am currently following this PDF for guidance (Supreme Commander 2 Pathfinding) but a lot of the technologies they use are meant for an RTS. Different groups of agents often have different goals to move toward to. Since i have a single, consistent goal, would i still implement things like an A* search through sectors based on an agent's location in the map (there's a lot of agents so..), or would i simply generate the flow fields in the sectors that are occupied?
Basically, since i have a single target at all times, which technologies should i use and which should i forget about

• Hello all,
We are a small team that would like to introduce our game - “Bondo 2 - Fusion of Domino”. It's "merging game" with levels.
The testing phase there were many questions. We are would like to hear constructive reaction about Tutorial of our game: very detailed or no, very long or ... etc.
We would be happy for any feedback.
Thanks!
iOS: https://itunes.apple.com/app/id1288081600

• 10
• 9
• 14
• 24
• 11