Slick-Util Library Load Fonts in 3d

Started by jonalu, December 26, 2011, 13:49:44

Previous topic - Next topic

jonalu

Im trying to import a ttf font into a 3D lwjgl game. When i render it, it does not show any text. if i use the example program in 2d, it works. I may be a noob, but I try to learn.

CodeBunny

Not sure, but I'm guessing you're running into a depth buffer / frustum culling error.

Slick fonts are designed explicitly to work in a 2D, orthogonal setup. Because of the finicky nature of OpenGL, the same code executed with different matrix settings will result in completely separate results.

Try pushing both the modelview and projection matrix, calling glLoadIdentity in each, and call glOrtho for the projection matrix. Then, render the font and pop both matrices. That may work.