Results 1 to 7 of 7

Thread: TEXT?

  1. #1
    Member Contributor
    Join Date
    Jul 2001
    Location
    South Africa
    Posts
    52

    TEXT?

    I am pretty emarrased to say, that I can't get text to be displayed properly in my app. I have a little first person walkaround. Everything works fine thus far, but the damn text. It gets displayed, but it's static and does not remain on screen. I rendered it whilst I was in gluPerspective, which killed the frames per second like nothing. OK I know I'm supposed to do it in glOrtho, but how do I switch to Ortho and then back to Perspective again? I tried a lot of things, and my text ends up correctly, but my whole 3D world is skewed and squished. It's really anoying, and I can't seem to get it right. Can someone help me pleeze.

  2. #2
    Guest

    Re: TEXT?

    The GLUT source distribution has a lot of examples.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    State College, PA
    Posts
    186

    Re: TEXT?

    Couple things:

    To switch from perspective to ortho:
    glPushMatrix();
    glLoadIdentity();
    glOrtho(yadda, yadda);
    //Draw text here
    glPopMatrix();

    Secondly - adding text is probably still going to kill your fps - there really isn't a really good, fast way of doing it: bitmaps are OK, but still not exactly blazing on most middle-of-the-road consumer cards. Not to mention the fact that last I checked, doing it in perspective in no slower than doing it in ortho - I think your problem is that your translations/rotations affect your text, and you don't want them to. The above code will fix that.

    Chris

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: TEXT?

    I can put the whole screen full with characters and it doesn't kill the performance too much? Are you using the pixel stuff from opengl or actually using textured quads?

  5. #5
    Member Contributor
    Join Date
    Jul 2001
    Location
    South Africa
    Posts
    52

    Re: TEXT?

    I'm using a font library with windows fonts.
    I sat last night for 5 hours trying to get it to work and I got it to, but it still kills the fps, damnit. So how does the professional people add text to the scene then? O yeah, I'm running a GeForce 2 btw, so I don't think it's the card.

    [This message has been edited by RedZen (edited 07-18-2001).]

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: TEXT?

    Use screen aligned textured quad, that should be fast. There's some stuff on this in the FAQ.

  7. #7
    Member Contributor
    Join Date
    Jul 2001
    Location
    South Africa
    Posts
    52

    Re: TEXT?

    Thanks dude.

Similar Threads

  1. Text rendering class does not draw text
    By th0masr0ss in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-23-2015, 09:10 PM
  2. 2D text
    By Flawe in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-19-2006, 07:12 AM
  3. Text for a text field
    By GrinderFX in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 12-30-2003, 11:44 AM
  4. Replies: 0
    Last Post: 11-15-2002, 02:58 AM
  5. 2D text in 3D
    By waynekt in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-02-2000, 05:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean