Page 1 of 1

billboard problem

Posted: Wed May 11, 2005 7:36 pm
by Omberon
Hello,
What I want to do is to have the name of characters in my game displayed over their heads like you see in many mmorpgs. I could be wrong but I think that to do this I should make a billboard and attach the billboard to the mesh and then position the billboard so that it is above the mesh. The only problem is that I don't know how to do that. If anyone could help me that would be great.

Posted: Wed May 11, 2005 8:00 pm
by afecelis
why not use:

Code: Select all

smgr->addTextSceneNode
as in example 10 (shaders). This way you can attach it to your players and it will be visible from any angle (like a billboard)

Posted: Wed May 11, 2005 8:48 pm
by Omberon
Ok, thanks, I never thought of that. I'll try it.

Posted: Wed May 11, 2005 9:24 pm
by Omberon
This works but, when I go behind buildings I can still see the text. That's why I wanted it to be a billboard, it wouldn't be visible through walls.

Posted: Wed May 11, 2005 10:09 pm
by Omberon
Here is my real problem right now. I'm creating a node with
scene::ISceneNode* billg = 0; and then creating it later on with
billg = smgr->addBillboardSceneNode(mesh, core::dimension2d<f32>(30, 60));
the first parameter, mesh, is the model I want to attach the billboard to. The problem is that I can only attach billboards to other nodes, not AnimatedMeshes. Is there some way to maybe create a node that both the mesh and the billboard use to define their positions maybe? If anyone knows please help.

Posted: Thu May 12, 2005 12:32 pm
by saigumi
You don't pass addBillboardSceneNode the mesh for it's Parent. You pass the sceneNode that the mesh is in.

Code: Select all

virtual IBillboardSceneNode* irr::scene::ISceneManager::addBillboardSceneNode  (  ISceneNode *  parent = 0,  
  const core::dimension2d< f32 > &  size = core::dimension2d< f32 >(10.0f, 10.0f),  
  const core::vector3df &  position = core::vector3df(0, 0, 0),  
  s32  id = -1 
 ) 

Posted: Thu May 12, 2005 5:11 pm
by Brinsky
Maybe you should try using: mesh->getMesh(0), as the first parameter instead of: mesh. This way (just guessing outloud) the billboard is attached to the first frame of the animated node (and reads it as a static node instead of a dynamic kind). As I said - just a wild guess - if it's wrong someone correct me please!

Posted: Thu May 12, 2005 7:27 pm
by Omberon
I figured it out. First I need to create an AnimatedMeshSceneNode. Then I can attach a mesh to that node and then I can attach the billboard to the AnimatedMeshSceneNode which makes both the mesh and the billboard now connected. The only thing I have to do after that is reposition the billboard so that it's above the mesh's head instead of sticking out of the middle of the mesh. Thanks for truing to help me.

Posted: Sat May 14, 2005 11:04 pm
by Ishtm
If i dont mistake there is an example of that.... #10 using shaders

good look!

Posted: Sat May 14, 2005 11:38 pm
by TheRLG
hey post a screen of what u have plz, im interested to see how its looking.

Posted: Fri Jun 03, 2005 8:00 pm
by Omberon
Sorry I didn't post a screenshot earlier. Here it is:
Image