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.
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.
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.