How to get object position?
Posted: Fri Nov 03, 2006 10:27 pm
I have model with 2 objects.
How to get position of one of the objects in the sceene?
How to get position of one of the objects in the sceene?
Official forum of the Irrlicht Engine
https://irrlicht.sourceforge.io/forum/
Code: Select all
//add b3d animated gremlin
scene::IAnimatedMeshSceneNode* anode = 0;
scene::IAnimatedMesh* mesh = 0;
mesh = smgr->getMesh("../media/gremlin.b3d");
anode = smgr->addAnimatedMeshSceneNode(mesh);
anode->setPosition(core::vector3df(50,5,-75));
anode->setAnimationSpeed(1000);
anode->setLoopMode(true);
anode->setScale(core::vector3df(1,1,1));
scene::ISceneNode* hand = 0;
hand = anode->getB3DJointNode("thumbR1");
scene::IAnimatedMeshSceneNode* smfairy = 0;
smfairy = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../media//faerie.md2"));
smfairy->setMaterialTexture(0, driver->getTexture("../media/faerie2.bmp")); // set diffuse texture
smfairy->setScale(core::vector3df(0.5,0.5,0.5));//makes it small
smfairy->setMD2Animation(scene::EMAT_SALUTE);
if(hand != 0)
{
//put the little fairy in the gremlins hand
hand->addChild(smfairy);
//smfairy->getAbsolutePosition
}