Page 1 of 1

Attaching a mesh to a camera node.

Posted: Fri Sep 17, 2004 1:46 am
by muska
I am trying to attach a mesh to a camera so that the mesh stays with the camera as it moves around. Which camera node should I use for this and how do I get it to stay with it? I've been playing around with it for a while but I still cant get it to go.

Posted: Fri Sep 17, 2004 1:52 am
by timmy
have a search through the forums, this has been asked many many times before.

The most common would be something todo with weapons

Posted: Fri Sep 17, 2004 1:54 am
by muska
timmy wrote:have a search through the forums, this has been asked many many times before.

The most common would be something todo with weapons
believe me, i've searched but I cannot find a good explanation. I must have read at least 1000 threads looking for it.

Posted: Fri Sep 17, 2004 2:08 am
by Robomaniac

Posted: Fri Sep 17, 2004 3:08 am
by Guest
i appologize for beating a dead horse and I thank you for the replies. The searches I did seemed quite botched, I wish I would have found that thread in my travels. Thanks again.

Posted: Fri Sep 17, 2004 8:40 pm
by muska
I think you may have misunderstood what I meant, and I probably have not been clear on implying it. I want the mesh to stick with the camera as I move forward (Not just the side to side motions as it is now)

Posted: Fri Sep 17, 2004 8:50 pm
by bal
Load node, set its position, load camera and do camera->addChild(node); ?

Posted: Fri Sep 17, 2004 8:54 pm
by muska
bal wrote:Load node, set its position, load camera and do camera->addChild(node); ?
I do have that, yet the camera plows right through the mesh.

IAnimatedMeshSceneNode* weaponNode = smgr->addAnimatedMeshSceneNode(mesh, camera, -1);

weaponNode->setScale(vector3df(14,10,14));
weaponNode->setPosition(vector3df(23,-10,5));
weaponNode->setRotation(vector3df(180,0,180));
camera->addChild(weaponNode);