• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Open GL and printing text onto screen

Status
Not open for further replies.

Shompola

Banned
Hello my friends,

I am trying to print out text onto the screen and I have the problem of that parts of text will dissapear if an object moves to where(x and y coordinates) the text is. I am using rasterpos2 function to set the text coordinates, unfortunately it operates in world coordinates as you know so it's connected to the camera node at all times- although that itself is no problem. For your information I draw the text with bitmaps(windows fonts) and not textures but I can't see how textures would fix the problem. I read somewhere that I should disable GL_DEPTH_TEST, will it really work correct? The world is in 3d coordinates and I wonder how disabeling the depth test would affect the 3d world.

Best would be if I could write the text directly into the framebuffer with screen x and y coordinates but I have failed to find a way to do that in Open GL.

Thansk for reading.
 

Phoenix

Member
Are you trying to do this as an overlay such that it is always drawn in front of your 3D world or are you trying to draw IN your 3D world. I can help you out with this but I need to understand some more about your requirements.
 

Shompola

Banned
Hi,

Yes I want it to be drawn in front of my 3d world all the time like hud info in games. It works just fine as long as there is no other object in the x,y position of the text. As soon as there is a 3d object on the x, y position of the text it will partly obscure the text like the 3d object is clipping thru the text.
So it doesn't matter if the 3d object is in the far distance from the camera, it will still clip thru the text hmm. So I thought easiest would be to put the text in the frame buffer after the rendering process but I can't figure out how to do that.

If you can help please tell :)

Thanks in advance.
 
Status
Not open for further replies.
Top Bottom