one question about position.
one question about position.
getAbsolutePosition() and getPosition() return values difference.
thanks!
thanks!
-
- Posts: 199
- Joined: Tue Dec 09, 2008 2:55 am
World origin or (0, 0, 0) in the the world coordinate system.hzsyber wrote:getAbsolutePosition is self origin or world origin?
Yes. If a node is created without a parent, both of these functions will return the same value. If the node has a parent, and the parent is not at the world origin (i.e., parent->getAbsolutePosition() returns something other than (0, 0, 0)) then the values will differ.hzsyber wrote:and,i load a node, getAbsolutePosition and getPosition return value is equally.
Uh... node->getAbsolutePosition() is the offset from the node position (in world coordinates) to the world origin.hzsyber wrote:how to i get a node position return from world origin?
maybe model design no position on world origin.
i want know model and world origin length.
someone can try my model. tell me how to know?
my code:
download model:http://www.reqi.com/md2.rar
thanks all!
i want know model and world origin length.
someone can try my model. tell me how to know?
my code:
Code: Select all
nodes[k] = smgr->addAnimatedMeshSceneNode(smgr->getMesh(modelfile.c_str()));
// nodes[k]->setScale(StrToV3df(scale));
nodes[k]->setMaterialTexture(0, driver->getTexture(texturefile.c_str()));
nodes[k]->getMaterial(0).Shininess = 50.0f;
nodes[k]->setLoopMode(false);
nodes[k]->setMaterialFlag(EMF_LIGHTING, false);
thanks all!
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Code: Select all
const core::aabbox3d<f32>& box = nodes[k]->getBoundingBox();
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
I'm not really sure where to start, but there have been some serious confusions about a sceneNodes position, absolute position, and relative position for me... and as I read in the forum for quite a few other people...
Well as hopefully any sane person would expect a relative position is relative to its parent. If you would call getPosition() on a node with a parent you would get its position relative to its parent. Likewise if you would call getAbsolutePosition() on a node with a parent node, you should get its position relative to (0,0,0), provided you call updateAbsolutePosition() before like vitek stated earlier.
If the node however doesn't have, never had, and never will have a parent node, then getPosition() should also always return its position relative to (0,0,0)
And without stating the obvious much longer, my question would be...
never hesitate stating the obvious...
Is that currently the case ?
because I find myself more often than seldom using getBoundingBox() Methods to determine the absoultePosition of nodes....
Well as hopefully any sane person would expect a relative position is relative to its parent. If you would call getPosition() on a node with a parent you would get its position relative to its parent. Likewise if you would call getAbsolutePosition() on a node with a parent node, you should get its position relative to (0,0,0), provided you call updateAbsolutePosition() before like vitek stated earlier.
If the node however doesn't have, never had, and never will have a parent node, then getPosition() should also always return its position relative to (0,0,0)
And without stating the obvious much longer, my question would be...
never hesitate stating the obvious...
Is that currently the case ?
because I find myself more often than seldom using getBoundingBox() Methods to determine the absoultePosition of nodes....
Just as a note ...all scene nodes have some parent. If you don't assign parent yourself then it is root scene node. Since its origin is at global origin than calling getPosition on one of its children will return their absolute position.