I want to draw text and an image on a specific position in 3D Space. The scene is rendered in 3D and I want to display a rendered 2D Text and an image on a XYZ-Coordinate.
I have the World, View, Projection Matrices from the scene and the ViewPort. I don’t want to render a real 3D-Font and I also don’t want to display the image with texture vertices.
I’ve tried some matrix multiplications with the transformation matrix and I also tried to use the basic effect as parameter for the begin-method. But non of them worked for me.
try this,
in the spriteBatch.Begin() parameters turn culling off and flip all draws vertically.
Use the basic effect as in the code you posted to pass WorldViewProj.
The transformationMatrix is for WorldView only, spritebatch uses transformationMatrix in combination with the internal projection matrix.
(in theory you can calculate the same projection as spritebatch, invert it, and then multiply it with your new projection and pass a combined transform matrix (worldviewmyproj*invProj) which in the end will negate the internal projection)