position of animated mesh not node or bone position [solved]

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
jsmurthy4
Posts: 18
Joined: Mon Sep 10, 2007 4:04 pm

position of animated mesh not node or bone position [solved]

Post by jsmurthy4 »

Hi ,
what i want is an animated mesh moves from a place X to Y after reaching Y it plays some other animation and again it moves from Y to Z.

Its example i may have U V W X Y Z or more positions

It may contain repeated animation between UV, YZ and also animation's may picked by situations or randomly

So i created an animated mesh file (.x file). when i am playing animation in a loop it move from a place like X to Y and again it go back to X or if i play some other animation(same node) it again go to X and plays.

I use node->setPosition(core::vector3df(0,0,0));
When i play animation, character moves but its node position is still 0,0,0 how can i get position of animated mesh not node

please help me :?:

Thank you all in advance
Last edited by jsmurthy4 on Wed May 28, 2008 3:58 am, edited 1 time in total.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Is this because the animation of your model is moving the model from the model's origin rather than you moving it with you own code?

If so then the best solution that springs to mind would be to have a bone/joint in the model that's connected to a suitable part, perhaps the centre of the model. And you use that to find it's location. .X files support bones, as do .ms3d and .b3d.
Image Image Image
jsmurthy4
Posts: 18
Joined: Mon Sep 10, 2007 4:04 pm

setjointmode getjointnode bone position [solved]

Post by jsmurthy4 »

Hi,
In animation, character moves but its node position is still 0,0,0 to get its exact position u need a particular bone position or to get a bone position in .X file format

Code: Select all

core::list<scene::ISceneNode*> lst;
scene::IBoneSceneNode *node3;
killer->setJointMode(scene::EJUOR_READ);  
scene::ISceneNode *node2=killer->getJointNode("Bip02");
lst=node2->getChildren();

core::list<scene::ISceneNode*>::Iterator psntnode;
core::list<scene::ISceneNode*>::Iterator endnode=lst.end();
					
for(psntnode=lst.begin();psntnode!=endnode;++psntnode)
 {
     node3=(scene::IBoneSceneNode *)*psntnode;
     core::stringc mystr=node3->getBoneName();
     if(mystr=="Bip02_Prop1")  //Name of the bone
           myresp::shoot(node3,vec);
 }

i thank some of the forum's to getting this code

for more information click below

http://irrlicht.sourceforge.net/phpBB2/ ... light=bone

http://irrlicht.sourceforge.net/phpBB2/ ... ight=joint
Post Reply