PDA

View Full Version : Unimetric Sprites



11-16-2002, 11:30 PM
I'm working on a small terrain engine that draws sprites and text (using textured quads) at certain points on the map. I have everything 'billboarding' fine (the text and such always faces the viewer), but what I'd like to do and can't quite figure out is how to get the sprites to always render at a constant size regardless of distance from the camera. I've tried playing around with an orthogonal projection matrix, but haven't been able to get anything to work. Since I'm using my own bitmap font, I want the text to appear 'pixel perfect'. Any ideas?

gumby
11-17-2002, 04:52 AM
Don't draw the sprites in world
space. Draw them in screen space. You can calculate the 2D screen coordinate by transforming the 3D world coords.

11-17-2002, 08:43 AM
Thanks.. does OpenGL provide functions for this, or do I need to do the math myself?

gumby
11-18-2002, 02:44 PM
Hi,
I seem to remember an Unproject command. I can't remember if it is gl or glu though. You can also glGet the matrices and project the point yourself.