billboard problem
billboard problem
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.
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.
why not use:
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)
Code: Select all
smgr->addTextSceneNode
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.
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.
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
)
Crud, how do I do this again?
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!
10 I lovez my computer
20 goto 10
20 goto 10
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.