Archived

This topic is now archived and is closed to further replies.

Paddeh

Console

Recommended Posts

I''ve been trying to make a working console for the past few days, i''ve gotten as far as making a texture mapped 2d object come down. However, it allways comes down in the place where translatef tells it to. is there a way to get it to position over everything else? what i mean is. instead of when i use my movement keys the console stays in the same place, i want it to stay snapped to the screen. like consoles do in all games If anyone knows how to go about this then any help would be greatly apreciated.

Share this post


Link to post
Share on other sites
You could setup an orthographic projection matrix before rendering the console (and any other UI stuff, like a HUD, menu, text, whatever...). Use the glOrtho or gluOrtho2D functions for this, and do it after rendering anything that should be in the perspective view (to avoid unnecessary switching of projection matrices)

Share this post


Link to post
Share on other sites
thanks for replying sadly im a total n00b and have no idea how to use those functions. I have the "OpenGl Programming Guide" book, so hopefully it should mention them in there. thanks again

Share this post


Link to post
Share on other sites
Perhaps the most obvious solution is that if translatef is telling the console where to go, don''t translate before you draw the console - use glLoadIdentity to use the standard - untranslated - modelview matrix.

You''ll have to do that even if you use glOrtho, but glOrtho is a good idea because it makes positioning things in 2D much easier.

I demand unsatisfaction!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
billboards??
also, i''ve checked around, but i cant seem to find any info on how to use glortho() and its 2d counterpart. Anyone know of anywhere :/?

Share this post


Link to post
Share on other sites