LWJGL

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Render text  (Read 4060 times)

snapsen

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Render text
« on: February 15, 2012, 20:01:04 »

Hi All

I'm a newbie to OpenGl, in the process of creating an applet to illustrate the computation of some miter and bevel angles when cutting wood (for another application). Found a lwjgl gears applet which convinced me to use lwlgl (don't know if this was the correct decision, but i had to start somewhere). Apart from the expected startup problems (like normals pointing in "funny" directions and such) have been moving along pretty well. Now i'm trying to render some text in the 3d space, and i'm failing miserably. Found an example of this on potatoland which renders text on some spheres. Works fine in a console app. I then tried to gen these to work in my applet, but i'm unable to get any text in my applet. Ended up creating an applet with just the sphere (which displays fine), and the text. Can anyone give me a hint on how to achieve this, i'll be grateful.

br
Karsten.
Logged

kappa

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1226
Re: Render text
« Reply #1 on: February 15, 2012, 20:13:51 »

Try Slick-Util, instructions here.
Logged

snapsen

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Re: Render text
« Reply #2 on: March 02, 2012, 06:50:53 »

Doh....

As stated, i'm a new to opengl. Tried using JOGL as it has a TextRenderer class. Turns out that the quality is not as good as expected. Could not get Napier code to work under JOGL either.

Textures needs to be enabled.

      GL11.glEnable(GL11.GL_TEXTURE_2D);   // be sure textures are on


Working fine now
Thanks
Karsten.

Logged