Displaying text
Displaying text
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?
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
You can find the 2d position of a 3d position with:
Then you can create a normal gui text object and place it there.
Code: Select all
smgr->getSceneCollisionManager()-> getScreenCoordinatesFrom3DPosition(pos);
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
indeedCuteAlien wrote:I guess what instinct wants is text in another perspective.
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?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.
-
- Posts: 277
- Joined: Thu Dec 15, 2005 6:11 pm
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.
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.
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.
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.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
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.
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.