ploblem after I set chaild Node and set transformation

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
Espanol
Posts: 40
Joined: Sun Oct 22, 2006 3:28 am

ploblem after I set chaild Node and set transformation

Post by Espanol »

I must apologize if it is a newbie problem but I can't solve this.

I have been add IAnimatedMeshSceneNode, it is a soldier model, and then add one sceneNode it is a shadow plane and set the shadow position to position at soldier foot but the result after run program it is disappear but if I didn't set it position it is appear but not at my soldier foot.

How can I set its position.

Another one is sword, I get ISceneNode* from getXJointNode("joint_name") for attach sword model to be its child and after I set its(sword) position and rotation to match the position and rotation of hand joint, it is disappear too.

Please help, thank you very much.
kneri
Posts: 32
Joined: Sun Sep 17, 2006 4:55 pm
Location: Austria

Post by kneri »

give us some code to look at!
Espanol
Posts: 40
Joined: Sun Oct 22, 2006 3:28 am

Post by Espanol »

IAnimatedMeshSceneNode* soldierNode = smgr->addAnimatedMeshSceneNode(smgr->getMesh("soldier.X"));
IAnimatedMeshSceneNode* shadowNode = smgr->addAnimatedMeshSceneNode(smgr->getMesh("shadow.X"), soldierNode, 1, core::vector3df(soldierNode->getPosition().X,soldierNode->getPosition().Y - 8,soldierNode->getPosition().Z));
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Childnodes are relative to the position of theire parents. It looks like you make shadowNode a child of soldierNode and then you add the position of soldierNode once more. If you set it to (0,0,0) it would already be at the position of the soldierNode. In your case you might want to use vector3df(0, -8, 0). Not sure if this really is your problem, but it looks a little bit like that could be it.
Espanol
Posts: 40
Joined: Sun Oct 22, 2006 3:28 am

Post by Espanol »

if I set shadowNode's position at vector3df(0,100,0) after added it to be chaild of soldierNode, where the shadow is?, what it is position relate to world position?
Espanol
Posts: 40
Joined: Sun Oct 22, 2006 3:28 am

Post by Espanol »

please help. This topic is very nessesary for me. :cry:
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

if I set shadowNode's position at vector3df(0,100,0) after added it to be chaild of soldierNode, where the shadow is?, what it is position relate to world position?
It would be 100 units above the origin of soldierNode. The position is always relative to the parent.
Post Reply