PDA

View Full Version : Viewport viewing text?



diskhub
05-10-2011, 01:01 AM
Hi all,

I have 2qn.
Qn1:
a perspective viewport
and i wish to have some text appearing on the screen.
How can I do that?
I tried the following code on ortho view and it works but not on my perspective view...


gl.glPushMatrix();
gl.glTranslatef(0.0f, 0.0f, -2.0f);
gl.glColor3f(1.0f, 1.0f, 1.0f); glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, getText());
gl.glPopMatrix();

And 2nd Qn:
How can I load a 2d Texture on my perspective view as well?

carsten neumann
05-10-2011, 07:40 AM
1) If you want your text to appear on top of your scene (like a heads up display, HUD) you don't bother with rendering your text while the perspective projection is active. Instead first render your scene with the perspective projection, then switch to ortho and render your text.

2) Loading of textures has nothing to do with which projection is active, so that can not be what you were asking for and I can't guess what you'd really wanted to ask. Can you give another description of what you want to do?