PDA

View Full Version : 2d console question



uranium_junkie
01-12-2006, 05:35 PM
Hi, sorry if this is a blatantly stupid question. Me am a newbie

Iím trying to render a bitmap over the 3d world (like a game consol). Iíve being settling for rendering quads in front of the camera and texturing it but this doesnít work well when the camera moves. Also if I need to place another image over the original image they flicker back and fourth. Iíve also looked at glDrawPixels() but you canít seem to render another tga over it with Alfa values

Thanks for any help

shelll
01-12-2006, 09:28 PM
for console, use orthographic projection. glOrtho or gluOrtho2D. and then render all your HUD including console.

uranium_junkie
01-13-2006, 02:39 AM
so i render a second sceane using otho instead of perspective... ok i'll try that thanks :)

dorbie
01-13-2006, 04:22 PM
That's one option but either way you should also disable depth testing when you render your overlay, that's what is causing the flickering and can cause intersection with 3d objects in the scene unless you clear z, which would be very inefficient just for the overlay.

A textured quad is by far the most efficient way to do your overlay if the contents of the overlay is unchanging so definitely try to make this work rather than drawing the image direct with a drawpixels.