Hi
I’m pretty confused (still) over the whole orthographic/gluPerspective projections (as well as modelview/projection). Up untill now I’ve just been sort of winging it without really understanding when to change what and why.
Well now I have a problem that I can’t fix becuause of my lack of a clear understanding on when and why to use what and the proper way to go back and forth between these things…
I’ve written a font library that texture maps fonts I’ve created onto quads (for some reason I couldn’t get the NeHe tutorials to work. I wonder If it’s b/c I’m using GLUT)
Anyway,I want to use it in my little 3D world. I want to be able to place my text as an overlay to my 3D space. So if I walk up to a character, that I can display my textures at the bottom of the screen.
I’m sure this whole thing is as simple as a few lines of code in my draw function, but I don’t know what they are…
I got this from a tutorial but I can’t seem to control how big or where the textures appear on the screen.
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0, width, 0, height, 0, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPos2f(0,0);
drawText(“ACE?”);
glColor3f(0,1,1);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
This code will get my letters on the screen but they are blown up and I can’t seem to change that.
So, if any of you out there could offer a code snippet for this (even better would be a simple explanation into the idea of overlaying 2D text on a 3D world) I would greatly appreciate this.
Thanks so much