Results 1 to 4 of 4

Thread: GUI Text

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2000
    Location
    Edinburgh
    Posts
    5

    GUI Text

    I'm trying to draw an object rotate it and then print the rotation angle on the screen.

    I can do this but when the scene is rotated the text moves.

    How can I fix the text to stay in the top left hand corner of the window always facing the user.

    Thanks

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

    Re: GUI Text

    If it is there when you didn't move anything, you're allright. Simply put the drawing stuff before any position or viewport dependant translations.

    You could also, for example do this:
    glMatrixMode( GL_MODELVIEW );
    glPushMatrix();
    // load your starting matrix (might be simply the identity matrix)
    // draw your text
    glPopMatrix();

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2000
    Location
    Erlangen, Germany
    Posts
    28

    Re: GUI Text

    Hi miguel
    Can you give me sample code to print the text.
    thanks

  4. #4
    Junior Member Newbie
    Join Date
    Nov 2000
    Location
    Edinburgh
    Posts
    5

    Re: GUI Text

    Hi Michael,

    Thanks a lot I've managed to get it working now,
    I had to translate on z to bring it to the front of the screen and then transalte back (so it wasn't affected by zoom)

    The code is available for text on NeHe's tutorial site
    Link from opengl.org - coding section
    I think it's lesson 12 or 13 - Bitmap fonts.

    Thanks again Michael

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