PDA

View Full Version : Render Text in perspective Mode?



11&2
01-19-2011, 05:17 PM
Hi,

I want to render text for my app. Normaly one would use glOrtho for pixel accurate quad rendering BUT in my app the textbox should move in the background (z).

Just imagine you have NPCīs (objects) in a video game and want to display their names above their heads. The names of the persons near to the camera should appear bigger and easier to read than the ones farther away.

What should I do? Where do I get an appropriate Projection Matrix? I canīt find anything regarding the problem online or in books.

Best regards, S.

BKB
04-23-2011, 03:19 AM
Hi,

A good overview of setting up a projection view matrix can be found here:
http://www.songho.ca/opengl/gl_projectionmatrix.html

For a movable camera what you want to be doing is rendering the textured quad with a rotation inverse to any rotation in the in the camera view matrix, such that the quad plane is always perpendicular to the camera.