Displaying text

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
instinct
Posts: 87
Joined: Sat May 10, 2008 3:42 pm

Displaying text

Post by instinct »

I was wondering if it's possible to display some text in the world that does not act like a billboard. I noticed the basic ITextSceneNode is visible from every direction and 'through every wall'. I would like to place some text on the ground, without it being a billboard. How do i do this?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

You can find the 2d position of a 3d position with:

Code: Select all

smgr->getSceneCollisionManager()->	getScreenCoordinatesFrom3DPosition(pos);
Then you can create a normal gui text object and place it there.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I guess what instinct wants is text in another perspective. I guess it might be possible to render the text to a texture and use that texture on another object. I don't think we have already a general easy way to put text on some object otherwise.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
instinct
Posts: 87
Joined: Sat May 10, 2008 3:42 pm

Post by instinct »

CuteAlien wrote:I guess what instinct wants is text in another perspective.
indeed ;)

CuteAlien wrote:I guess it might be possible to render the text to a texture and use that texture on another object. I don't think we have already a general easy way to put text on some object otherwise.
that's too bad. I was hoping something like that already existed. The text i want to display can be dynamic, that's why i want to avoid using textures. Do you happen to have any other suggestions?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I don't see why avoiding textures is a good idea. Just render to a texture and display the texture as you want.
kburkhart84
Posts: 277
Joined: Thu Dec 15, 2005 6:11 pm

Post by kburkhart84 »

I have seen many OpenGL tutorials doing "outline" fonts, and I'm pretty sure that Direct3D could do something similar. What would the general opinion of implementing this in Irrlicht. It would be exactly what the OP needs, though I understand the performance that great.
The problem with doing it through render-to-texture is that it isn't a 3d object, rather a quad with texture.

On the other hand, if it were static text, it could easily just be modeled and rendered as such.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

The problem with outline fonts is that there's so many different types; Win32, FreeType, Glut, Cocoa and so on.
We'd need types for each renderer or operating system, each with its own external dependencies and each would look slightly different. We don't like external dependencies at all, but I suppose with the font factory stuff a FreeType plugin is probably the best option.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The OP doesn't want outline fonts, but just a way to "project" text onto some object. And the easiest way is to go via render textures.
If you need a vector font, just use the truetype add-on from CuteAlien's patch page or from IrrlichtML. Should do the job, but does not handle the issues from the first post.
Post Reply