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.
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)
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
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!
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!
what about billboards? i think it is somhow compley to create them, but as a solution for a console they would be fine.
cya, Sebastian J
cya, Sebastian J
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 :/?
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 :/?
Billboarding would be inefficient for such a simple task. Look at the NeHe tutorial where he does 2D stuff. Specifically, look at how he sets up the projection matrix.
[Resist Windows XP''s Invasive Production Activation Technology!]
[Resist Windows XP''s Invasive Production Activation Technology!]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement