Node Position Problem

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
stark
Posts: 7
Joined: Fri Dec 14, 2012 12:57 pm

Node Position Problem

Post by stark »

hi,every one,
i added 2 nodes and set the first nod as child of second node.
in view rendering i saw when i move or rotate second node the first node will move and rotate automatic(cause it joint) & it's ok.
but when want to get the current first nod position the function just call back (0,0,60) ! the first position i'v make it and not call back new position node
transformed by second node.

scene::ISceneNode * node = smgr->addSphereSceneNode();

node->setPosition(core::vector3df(0,0,60));

scene::ISceneNode* n = smgr->addCubeSceneNode();

n->setPosition(core::vector3df(0,0,30));

n->addChild(node);

n->setRotation(core::vector3df(-30,50,0)); //rotate 30pitch 50yaw 0roll (euler)

printf("x%f,y%f,z%f\n",node->getPosition().X,node->getPosition().Y,node->getPosition().Z); //i'v try to print new real current position nod but it just return position of setup it, just print (0,0,60) ! not return the real new transformed position by second nod.

The question : how to get the current real child's position or rotation ?

Thanks !
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Node Position Problem

Post by Brainsaw »

ISceneNode::getAbsolutePosition
ISceneNode::getAbsoluteTransformation::getRotationDegrees
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
stark
Posts: 7
Joined: Fri Dec 14, 2012 12:57 pm

Re: Node Position Problem

Post by stark »

Thank You Brainsaw !
Post Reply