Opengl Fonts and glRasterPos2f
Exists an easy way to tell opengl where to put text on screen ?, I am using display list and HFONTs, and then I have to use glRasterPos2f to put text on a screen position. I want something easy, user friendly, based on window height and width, like this:
PrintGL(FontList, win.height / 2, win.width / 2, "Hi world");
so it begin putting in window center the H letter.
thanks
what can I say... hmmm...
just read one from the NeHe tutorials
you can find information about fonts in 13th, 14th, 15th and 17th lesson
NeHe
when you read them you will be able create very nice pice of code... For example you will have glPrint function that works not only with 2d bitmap fonts but also with full 3 dimensional fonts! the lessons are great!
good luck :)
just read one from the NeHe tutorials
you can find information about fonts in 13th, 14th, 15th and 17th lesson
NeHe
when you read them you will be able create very nice pice of code... For example you will have glPrint function that works not only with 2d bitmap fonts but also with full 3 dimensional fonts! the lessons are great!
good luck :)
try to glOrtho() and glTranslate*()like this
bye! :)
glMatrixMode(GL_PROJECTION);glPushMatrix();glLoadIdentity();glOrtho(0,win.width,0,win.height,-1, 1);glMatrixMode(GL_MODELVIEW);glPushMatrix();glLoadIdentity();glTranslated(X,Y,0);PrintGL("Hi world");glMatrixMode(GL_PROJECTION);glPopMatrix(); glMatrixMode(GL_MODELVIEW);glPopMatrix();
bye! :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement