Which is the best technique for drawing "2D" in front?

Everything related to 3D programming
mrw
User
User
Posts: 76
Joined: Wed Dec 31, 2014 1:01 pm

Which is the best technique for drawing "2D" in front?

Post by mrw »

Hi,
As the headline states I´m trying to figure out the best way to have 2D graphics drawn in front of lots of 3D graphics, without caring about the resolution.
One example for this would be a control panel to a game. It could sit at the bottom of the screen and have buttons and other info on it.
Another obvious example would be a mouse pointer. To have the mouse pointer take up the same space on the screen regardless of the resolution.

The easiest way is probably to draw 2D sprites. But the main problem I have with that is handling different resolutions and I can´t draw a texture to a 2D sprite(or can I?). I want to control how much space of the screen it uses.
I could ofcourse create a "3D sprite"(a mesh with 4 vertices and 2 polys) and draw a texture to that, but how do I place it so it´s borders are exactly where I want them in 2D space? And also in front of everything else?

I have experimented a bit with BillBoards but I think they only solve having the sprite always pointing directly at the screen.

Any ideas on this?