Page 1 of 1

Make node parent of billboard Text node [solved]

Posted: Wed Jul 11, 2007 7:38 pm
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.

Posted: Wed Jul 11, 2007 7:55 pm
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.

Posted: Wed Jul 11, 2007 8:02 pm
by Dukdalf
yeah i had to scale in that way because otherwise the cube was inside out!
kk looking into it