Results 1 to 2 of 2

Thread: Viewport viewing text?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2011
    Posts
    8

    Viewport viewing text?

    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...
    Code :
    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?

  2. #2
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896

    Re: Viewport viewing text?

    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?

Similar Threads

  1. problems with text and viewport
    By snakepit in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-22-2003, 07:22 PM
  2. Replies: 2
    Last Post: 05-27-2002, 02:59 AM
  3. Viewport or multiple viewport in a window!
    By Boubou in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 11-30-2000, 05:45 AM
  4. easiest way to put text on OpenGL viewport?
    By Schlogenburg in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-30-2000, 07:04 AM
  5. easiest way to put text on OpenGL viewport?
    By Schlogenburg in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-28-2000, 04:32 PM

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