Attaching a mesh to a camera node.

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
muska
Posts: 5
Joined: Wed Sep 15, 2004 4:33 am

Attaching a mesh to a camera node.

Post 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.
timmy
Posts: 34
Joined: Wed Jul 14, 2004 2:48 am

Post 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
muska
Posts: 5
Joined: Wed Sep 15, 2004 4:33 am

Post 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.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

The Robomaniac
Project Head / Lead Programmer
Centaur Force
Guest

Post 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.
muska
Posts: 5
Joined: Wed Sep 15, 2004 4:33 am

Post 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)
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Load node, set its position, load camera and do camera->addChild(node); ?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
muska
Posts: 5
Joined: Wed Sep 15, 2004 4:33 am

Post 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);
Post Reply