Moves bones in real-time

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
Kaki
Posts: 41
Joined: Thu Oct 12, 2006 12:19 pm
Location: France

Moves bones in real-time

Post by Kaki »

Hi

In my new game (a tennis), I would like that the player can move his own bones character. In fact he can shoot the ball with the mouse. No animations would be export for the shoot, only the skin have to move. The dummy controllers are moved in a precalculate direction when the player scroll up or down with his mouse. The player don't have to knock hardly when he is in the net.

To do that I need to know if the .x format let me move the skin when I move a dummy object. The .x format exports dummy objects, isn't it ?
If it doesn't, please can you indicate me another format ?

Does my project seem to you practicable with Irrlicht engine?
Kaki
Posts: 41
Joined: Thu Oct 12, 2006 12:19 pm
Location: France

Post by Kaki »

No reply.

Well I choose to use the b3d format. To get the scene node which I want to move I use the getB3DJointNode function. But when I change the position of a joint, the mesh doesn't move. I don't understand why.

Below my code :

Code: Select all

m_main_gche = m_node->getB3DJointNode("Bip01 L Hand");

// in another cpp file the movement :

vector3df pos = m_Player->m_main_gche->getPosition();
pos += vector3df(100.0f, 0,0);
printf("position %d %d %d \n", pos.X, pos.Y, pos.Z); 
m_Player->m_main_gche->setPosition(pos);	
the position moves but in the scene nothing changes.

Have you got an explanation?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You don't have Inverse Kinematic in Irrlicht. You'll have to define the necessary animations. However, Luke's working on animation blending which will let you define animation fragments and blend them together to a more complex move.
If you want to use IK you might want to check out Poser. I guess these things are possible there and you can also find a Poser animation integration into Irrlicht on the forums.
Kaki
Posts: 41
Joined: Thu Oct 12, 2006 12:19 pm
Location: France

Post by Kaki »

If I define the necessary animations , I must use the following functions :

Code: Select all

 
setLoopMode (0);
setFrameLoop ( 0 *100 , 16 *100); // it's an example
But the blend is a priority when I want to inverse the movement.

Have you a got a link for the Luke's work ? Or for the process I must use to interpolate the fragments ?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

Hi I got a question Is it possible to make one bone animation and assign that to every model??

For example like human models if I have a people in a city that do same basic animation's like open a door to a store or walking or running ect?? is it possible to do in script?? So that this would save alot of time in animation so I don't have to re-animate every 3d model with the same animation.

Thanks for your time.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

No, because the vertices in the models would be different, so your animation wouldn't be mapped properly. You could have separate models for each body part and "script" animations that way, though.
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

What if I made like 2 models one male and one female and animate both then use those but in script display different skins.

So it's like a same model but diffent skin textures ect so it looks diffent and make the 3d modle bald and have different hair models and attach it to base male or female head so their can be alot differnet hair's ect and yet still have close to smae animations.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

If you have the same base model, and then attach different 'items' to their bones, then, yes, that would work.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

If you controlled the bones by code then it should all be possible...Are you sure your B3D model has the joints correctly attached etc? When I tried an X model from Blender they were not attached and I had to make them in MilkShape for it to work. I am not sure how stable Luke's B3D joint movement is at this stage, he said himself it is not tested so I recommend you try Acki's irrExtensions for the bone movement and attach the bones to an X model in MilkShape or something. (You can get a free 30 Day trial of milkshape so get that and do it quickly before it ends haha.)
Post Reply