Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8028533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:09:53+00:00 2026-06-05T00:09:53+00:00

i need some help to print a string over a opengl 3d scene. I

  • 0

i need some help to print a string over a opengl 3d scene.
I have some problems using modelview matrix and projection matrix. As I understand, projection matrix is used for the scene setup, and modelview matrix is used for drawing and transformating an object in the scene. So, to paint something over a 3D scene I understand that the next procedure most be done:

  • setup projection matrix for 3d scene
  • setup modelview matrix for 3d scene
    • draw opengl stuff
  • setup projection matrix for 2d overlay
  • setup modelview matrix for 2d overlay
    • draw opengl stuff for hud

Is this the right procedure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:09:55+00:00Added an answer on June 5, 2026 at 12:09 am

    For 2D rendering you can think of the projection matrix as you canvas and the movelview as the position of your text. You want to setup an orthogonal projection like this:

    glOrtho(0.0F, windowWidth, 0.0F, windowHeight, -1.0F, 1.0F);

    With this projection each unit means one pixel (glTranslate2f(120.0, 100.0) would position your text at pixel (120, 100). This projection maps the (0,0) in the bottom-left corner of your screen. If you want to map it to top-left corner you can do:

    glOrtho(0.0F, windowWidth, windowHeight, 0.0F, -1.0F, 1.0F);

    As of how to render text, OpenGL doesn’t support it by default which means either you have to create a font rendering lib or using a existing one. Before doing that, you’ll need to have in mind your needs for text rendering: Is is flat or 3D? It will be static or transformed(scaled, rotated), etc.

    Here you can find a survey on opengl text rendering techniques with pros and cons and libs:
    http://www.opengl.org/archives/resources/features/fontsurvey/

    I started using FTGL to render TTF font, but the lib was destroying my game performance. So I decided to implement my own font lib and went with texture fonts, which are not better than TTF, but it was ok for my needs.

    I used this program: http://www.angelcode.com/products/bmfont/
    It takes a TTF font and exports a texture and a file descriptor containing each letter position, size and padding in the texture that you will use to render.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help over here to understand how the model relationship works on
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some help with a query.. I have three tables. Source id name 1
I need some help in converting my script from using mysql to mysqli I
Need some help for creating a File and String search engine. The program needs
I need some help with the Python's new string formatter. Basically, I want the
Need some help about with Memcache. I have created a class and want to
Need some help understanding the difference between the success and ajaxSuccess events documented here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.