Make node parent of billboard Text node [solved]

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
Dukdalf
Posts: 24
Joined: Thu Jun 21, 2007 9:48 am

Make node parent of billboard Text node [solved]

Post by Dukdalf »

Hi guys,

I create a player and I want to attach some number and name to this player. When I will move the player, the text should follow.

Here is my code:

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh("media/cubeplayer.x");
IAnimatedMeshSceneNode* player1;
float pos = 170; 
player1 = smgr->addAnimatedMeshSceneNode(mesh);
player1->setID(1000);
player1->setMaterialFlag(EMF_LIGHTING, false);
player1->setPosition(core::vector3df(pos,151.f,-170));
player1->setScale(core::vector3df(-150.f,150.f,150.f));
smgr->addBillboardTextSceneNode(
   env->getFont("media/fontlucida.png"),
   L"<01>Pietje, Blitzer",
   0,                           // parent node pointer
   dimension2d< f32 >(750.0f, 150.0f),
   vector3df(pos, 400, -170),
   -1,
   0x00000000,
   0x00000000
   );
When i change the parent node pointer to player1 the text does not display anymore. Why is this, what am i doing wrong.
Last edited by Dukdalf on Wed Jul 11, 2007 9:05 pm, edited 1 time in total.
Just fooling around abit!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Your scale is strange, but the problem could be that the (then) relative position is quite far from the node - or too near to the center of the mesh.
Dukdalf
Posts: 24
Joined: Thu Jun 21, 2007 9:48 am

Post by Dukdalf »

yeah i had to scale in that way because otherwise the cube was inside out!
kk looking into it
Just fooling around abit!
Post Reply