bone rotation issue

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
badday
Posts: 102
Joined: Mon Aug 16, 2010 1:14 pm

bone rotation issue

Post by badday »

Hi,

I´m trying to point a barrel to some target. In order to do so I´ve got a bone. Now I´m trying to rotate that. But nothing happens.

Let´s say I´ve got a scene::IBoneSceneNode *b which got it´s value by node->getJointNode("boneName"); It does get a valid value, so there is a bone with that name in the animation file (.X).

Now I tried

Code: Select all

while(device->run())
	{
		
		b->setRotation(b->getRotation() + vector3df(1, 0, 0));
		
		driver->beginScene(true, true, SColor(255,100,101,140));
		smgr->drawAll();	
		gui->drawAll();
		driver->endScene();
	}
This should at least show some effect. But it doesn´t.

I tried to set b->setRotation(vector3df(0,0,0)); before the loop, but all results in the same: after 1 iteration true the loop, values stay the same, namely:
{,,Irrlicht.dll}((*(irr::scene::ISceneNode*)(&(*(irr::scene::IBoneSceneNode*)(&*(irr::scene::CBoneSceneNode*){*}b))))).RelativeRotation {X=180.10611 Y=89.410172 Z=179.71519 } irr::core::vector3d<float>
This doesn´t change any more.

Furthermore I noticed that rotationHint is set to -1. Is this a problem?


A lot of questions, I just hope someone can help me.


Thanks,

badday
Dareltibus
Posts: 115
Joined: Mon May 17, 2010 7:42 am

Post by Dareltibus »

is the barrel weighted painted?
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

you are using blender exporter?

blender exporting skinned meshes is common very problem here.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Try:

Code: Select all

while(device->run())
   {
      
      node->animateJoints(); // let Irrlicht animate the joints. Make sure you`re using EJUOR_CONTROL
      b->setRotation(b->getRotation() + vector3df(1, 0, 0)); // apply your rotation
      
      driver->beginScene(true, true, SColor(255,100,101,140));
      smgr->drawAll();   
      gui->drawAll();
      driver->endScene();
   } 
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
badday
Posts: 102
Joined: Mon Aug 16, 2010 1:14 pm

Post by badday »

You´re right, shadowslair. I did forget this.

Thanks a lot, problem is solved :)
Post Reply