[SOLVED]Dynamic Motions with Animations using CAL3d

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
op_nexus
Posts: 1
Joined: Fri Apr 06, 2007 7:54 am

[SOLVED]Dynamic Motions with Animations using CAL3d

Post by op_nexus »

Hi,

I m using Cal3d for animations in my game . I need help in mixing some dynamic bone motions with predefined ones . When i rotate any bone , i m able to do that but only when there is no animation loaded on my character, but otherwise it is not rotated. May be i know wht the reason behind this is that when an animation is loaded then it updates all bones according to the defined animation data , that is why any of my rotations are not done at the time when an animation is loaded.

Can anybody help that how can i rotate a bone along with my predefined skeletal animations ?

Edit:- I was able to do that. Here is what i did , hope this can help any other programmer in mixing runtime motions with predefined animations using Cal3d
I brought my bone to its core state ( the state where it was before animations) then i applied the rotations to this bone and updated the skeleton to calculate the original state and finally i got the o/p.
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hbraun »

Hi!

This post is really old... But, could you post the code part how you did that?

Thanks in advance,

Braun
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by mongoose7 »

It would do no good - it predates the "New Animation System". You probably want to set EJUOR_CONTROL on any bones you want to control. Set the bones after calling the animation function (I forget the name).
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hbraun »

But using Cal3D? The modeler/animator I am working with is exporting Cal3D models, but I would like to move their heads towards important assets on the scene. So far I managed to get real close, but I changed the Cal3D lib in some classes... So I believe there must be an easier way for that.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by mongoose7 »

Are you using a custom scene node to render the mesh that you get from Cal3d? If so, the animation is in your hands.
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hbraun »

Yes, I worked on a custom scene node, playing animations is just fine, the real problem is mixing "code animations" with the other ones already presented in the model.

"Edit:- I was able to do that. Here is what i did , hope this can help any other programmer in mixing runtime motions with predefined animations using Cal3d
I brought my bone to its core state ( the state where it was before animations) then i applied the rotations to this bone and updated the skeleton to calculate the original state and finally i got the o/p."

I believe that is the exactaly piece of code I would like to see hehehe :)

I will keep trying some stuff, if I manage to mix the animations I'll post here the code in case another programmer face the same trouble again :)
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by mongoose7 »

Maybe the real answer is to convert the animations on the model into Cal3d format. Then you can mix them as much as you want.
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hbraun »

Thanks mongoose, but I believe that maybe I couldn't explain correctly what I need.
I can mix and blend, without any kind of problem, predefined animations... What I can't do is mix the predefined with animations created at run time, hehehe as I said, I need to rotate their heads so they can look important assets during the game, while "walking" and etc. :(
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by mongoose7 »

Call

Code: Select all

node->animateJoints();
then set any joints you need, then render.
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hbraun »

Haha, sorry to ask but, have you ever used Cal3d?
That method is Irrlicht's native, right? For b3d or X models, NOT cal3d models.

Cal3d is totally different...
http://gna.org/projects/cal3d/

The code for using it, is something like this:
"CalModel->getVectorBone[nHeadBoneID]->lockState();
CalModel->getVectorBone[nHeadBoneID]->setRotation(oQuatRot);
CalModel->getVectorBone[nHeadBoneID]->calculateState();"

Cal3d Is Character Animation Library (CAL), so it is very different than "animateJoints"... Unless you implemented (overrride) the "animateJoints" method or something like that, than I would like to see the CAL3D code for that hehe.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by mongoose7 »

I though you were using Cal3d with Irrlicht? So the models are not in Irrlicht, and the animations are not in Irrlicht. Therefore, you're question must have been, how can I add dynamic movements to Cal3d models in Cal3d? Yes?
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hbraun »

Yes :)

Irrlicht is responsible only for rendering.
I want exactaly what the title of the topic says...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [SOLVED]Dynamic Motions with Animations using CAL3d

Post by hybrid »

Uhh, in that case this is more for off-topic or 3d graphics forum...
Post Reply