Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: How do I keep a billboard the same size on screen regardless of the cameras position?

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2010
    Location
    us
    Posts
    12

    How do I keep a billboard the same size on screen regardless of the cameras position?

    I recently added a billboard to display a character's name into a game. It looks good except for I would like to keep the name the same size on the screen regardless of how far the camera is from other players. How can I do this?

    This is a 3D game being written using OpenGL ES 2.

    Any help is appreciated.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2012
    Posts
    129
    You can project the position of the players into window coordinates (using gluProject or custom matrix math) and then render name tags in an orthographic projection. I think you can also set the model-view-projection matrix's values to 1 at indices 0, 5, 10 to remove scaling. I am not sure on that one though.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Posts
    164
    Quote Originally Posted by xman84 View Post
    This is a 3D game being written using OpenGL ES 2.
    You want your billboard to behave like bitmapped characters, i.e. always facing the camera, never changing size, and following an object as it moves in 3D space. This is exactly what glDrawPixels does in conjunction with glRasterPos. Not sure if glDrawPixels is available to you in OpenGL ES.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •