Heads Up Display in OpenGL
im trying to create a Heads up display in OpenGl that basically stays on the same position on the screen no matter where the camera is in the 3d scene, i managed to achive this quite well using Ortho2d, the problem is i want to render and roate 3d objects in the HUD which cannot be done using Ortho2d as is has no depth to it etc basically its 2d only.
Someone must have done this?
Thanks
check the faq http://www.frii.com/~martz/oglfaq/ section 9 u want to use a 2d orthogonal projection matrix
its not that hard to do i H.U.D ... i have one in my program called ''complex'' http://zerosignull.shortcut.to/ the best way to do it is to simply, draw ure level then disable the depth buffer then draw ure HUD that way u will always have ure hud where u want it. just make sure u draw the HUD LAST! or u will loose it behind ure level . i sujest tranlating into the sreeen by about -1 units and then draw or u can juste xperiment with deferent values, this way u dont have to change the projection matrix or ne thing and u have beatifull full 3d
~prevail by daring to fail~
~prevail by daring to fail~
Source code examples please? when your talking about disableing the depth buffer i presume you not talking about in Orth2D mode, as its IMPOSIBLE to get a good 3d perspective in ortho2d.
Please show me some HUD source
Please show me some HUD source
quote:Original post by asaariOriginal post by opless
All
Your
Base
Are
Belong
To
Us
:^)
what an insightful answer! =}
WHAT YOU SAY ?!?!?!
:D
Hi,
Use glOrtho(yadda yadda... ) instead of Ortho2D... this way, you can define a near and far clip plane.
It''ll be a bit tricky to rotate 3D objects on it, however. If you just want to rotate them around the z axis, then that''s no problem...
However, if you want to rotate them around another axis, you''ll probably have to move the HUD back in the z plane, and then try...
Granted, I''m not sure if this''ll work or if it''s what you''re looking for... but I tried. :-D
--Nairb
Use glOrtho(yadda yadda... ) instead of Ortho2D... this way, you can define a near and far clip plane.
It''ll be a bit tricky to rotate 3D objects on it, however. If you just want to rotate them around the z axis, then that''s no problem...
However, if you want to rotate them around another axis, you''ll probably have to move the HUD back in the z plane, and then try...
Granted, I''m not sure if this''ll work or if it''s what you''re looking for... but I tried. :-D
--Nairb
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement