Page 1 of 1

Texts are visible trought the walls

Posted: Mon Aug 14, 2006 2:32 pm
by Mancuso Raffaele
I need that the texts aren't visible trought the walls! how to do this?? I try with:

Code: Select all

collides_obj[i].text->setMaterialFlag(video::EMF_ZBUFFER,true);
collides_obj[i].text->setMaterialFlag(video::EMF_ZWRITE_ENABLE,true);
but not happens!! thanks.

Image

Posted: Mon Aug 14, 2006 3:14 pm
by vitek
You'll have to stop using addTextSceneNode. The existing version draws the text to the screen at the appropriate 2d position. It does not take object occlusion into account.

Posted: Mon Aug 14, 2006 3:31 pm
by Mancuso Raffaele
You'll have to stop using addTextSceneNode. The existing version draws the text to the screen at the appropriate 2d position. It does not take object occlusion into account.
so.......how to make text invisible trought the walls?

Posted: Mon Aug 14, 2006 6:39 pm
by Warchief
I've made something similar using billboards.

Posted: Tue Aug 15, 2006 4:42 pm
by Mancuso Raffaele
I've made something similar using billboards.
but I use text to show life,armour and munitions. For life and armour I "just" create 100 image file (because life is between 0 and 100), but the munitinos can be 9999999999999. So? Is there noway to enable zbuffer test on a text scene node?

Posted: Tue Aug 15, 2006 5:21 pm
by Warchief
Mancuso Raffaele wrote:
I've made something similar using billboards.
but I use text to show life,armour and munitions. For life and armour I "just" create 100 image file (because life is between 0 and 100), but the munitinos can be 9999999999999. So? Is there noway to enable zbuffer test on a text scene node?
Uhm i have damage numbers using billboards. Do you think i have made 999 numbers? Hehe, i've just done numbers from 0 to 9 and a fuction to join several images into just one using IImage to ITexture.

Btw, i have not used texts, so i don't know about disabling zbuffer for them. Sorry.

Posted: Wed Aug 16, 2006 3:29 am
by Mikenoworth
I'm not sure but you can try to use render to texture to use your basic fonts to make a texture for the billboards.

Look in the forums for topics on rendering to textures, or check Irrlichts help file.

Posted: Wed Aug 16, 2006 11:32 am
by Mancuso Raffaele

Posted: Wed Aug 16, 2006 12:42 pm
by omaremad
Keep the text scenenode!

You probably already have a ray/vector joining that enemy with that text scenode, test it for collision with te level if collision is true.

textscenenode>setVisible(false);