# 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

• 45
• 11
• 17
• 11
• 13
• ### Similar Content

• I'll be buying a new laptop as my workstation for building games, Mostly 3D but not hard core.

I'm stuck at choosing between these 2 specs below. Does this really matter and if so, can some one tell my how and why it matters.
Choice1:
Intel core i5-8250U (8th gen Kabylake refresh)(6 MB Smart Cache, 1.6 GHz Base with Turbo Boost up to 3.4 GHz) 4 cores 8 threads
RAM 8 GB DDR4 (2400 MHz)
GPU 2 GB DDR5 Nvidia MX150 256 bit
SSD: yes
Choice2:
Intel core i7-7500U 2.70GHz Base Processor (4M Cache, up to 3.50 GHz Boost) 2 Cores, 4 Threads
RAM 4 GB DDR4 (1800 MHz)
GPU 2 GB DDR5 Nvidia GeForce 940MX 256 bit
SSD: No

• By owenjr
Hi there.
I'm pretty new to this and I don't know if it has been asked before, but here I go.
I'm developing a game using SFML and C++.
I would like to use the "Tiled" tool to load maps into my game but I don't actually find any tutorial or guide on how to exaclty use it (I know that I have to read an XML file and stuff). I just step into diverse projects that make all a mess.
Anyone knows where can I find good information to make my map loader by myself?

• Today again I painted the next drawing. I look at him and I understand that something is wrong in him. Can problems with the prospect or with black and white or with the composition or is everything terrible? help me figure it out, help.. My english is not very well, i'm from russia and i want to draw for game

• Hello guys,
I've released my game for the first time. I'm very excited about it and I hope you'll enjoy the game - Beer Ranger. It's a retro-like puzzle-platfromer which makes you think a lot or die trying. You have a squad of skilled dwarfs with special powers and your goal is tasty beer. There is a lot of traps as well as many solutions how to endure them - it is up to your choice how to complete the level!
Link to the project: Project site
Link to the Steam site with video: Beer Ranger
Have fun and please write feedback if you feel up to.
Some screens: