Animation tween

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
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Animation tween

Post by fortikur »

I got an .x mesh with "walk" animation and another file with the same mesh with "run" animation (skeletal anim).
If I press say "a" the character should walk, but if I press "w" it should run. If I lift my finger up form "a" and press "w" the walking motion stops and the "run" anim starts - which is correct. The only problem is, that there is no tweening from one motion to the next.

I once made an engine, where you could conect the animations, so, it can be done, but only with quaternions.

What I would like to know is, if there is a possibility to make motion tweening in Irrlicht?
I downloaded the IrrExtensions, and found "MultiAnimations". I don't know if it was made for this kind of problem. But anyway, it is written in the help file, that it only supports "Irrlicht versionen 0.14 and 1.0". Now Irrlicht 1.1 is out...
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

I’m working on want you are talking about,

Is this what you mean?
http://www.fileden.com/files/2006/8/10/ ... itions.zip

I’m getting it to work with .X and .ms3d too.


Also you say you have two files, one with a walk and the other a run. Do you hide one and display the other to you game?


I’m not sure how people make game without it, no transition looks pretty bad.
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

This is exactly what I meant.
I've been looking through the forums for hours now and found this question asked many times, but with different aspects. and bang! here it is! The reply I wanted to have. I was thinking about to leave Irrlicht and switch to genesis3D, but I had a feeling, I should wait for a reply.

Luckily, i work with .x models too and this will ease my development a lot.
Also you say you have two files, one with a walk and the other a run. Do you hide one and display the other to you game?
In my old engine I loaded the first file with the mesh. This was called "idle". This was the animation when the actors didn't do anything, just looked around, waiting for a keypress (like your characters). The other anims were loaded from files where the charater was animated. I just loaded the animation and stored in the RAM, or on disk depending on my needs.
In this Irrlicht-case I'm just looking for a way to connect animations together as you did.
I’m not sure how people make game without it, no transition looks pretty bad.
That's right. I saw a bunch of games without this technique. Awful...

You saved my life :D
Thank you
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

Luke, may I ask you for a favour?
could you send a snippet of your code, how to make this animation-connection?
You use skeletal animation, right?

Thank you in advance
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Yes, I’m using skeletal animation,

I decently release the source but that demo you saw uses transitions in the b3d animater, and cannot do transitions across different meshes.

As we speak (type) I’m moving it in to the AnimatedMeshSceneNode, so it works with all formats, and can do all the stuff you are talking about. (I can send you the source as it is if you want or do you want to wait?)

I have also made the ISceneNode returned from getXJointNode/getB3DJointNode/ getMS3DJointNode editable without breaking any code (backward compatible), and usable with multipliable meshes (that are the same), and with animations playing.

Just need to fix some bugs, and I release it, I shouldn’t be too long, but it depends on "real life".
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

cannot do transitions across different meshes
No problem. Different characters walk different ways in my game, or if there are similar actors, they have the same models, animations.
I will just make transitions with one given mesh, using animations that are suitable for it (same amount of bones, vertices, etc.)
Almost like your demo, but with pre-rendereb backgrounds and fixed cameras.

I would be very happy to see how you did this technique, but if you think, that this code shouldn't be viewed by anyone, because it may contain some bugs :D I will understand. Anyway, I would be happy to have this code. Thank you.

One question:
What technique does your algorithm use? I mean, do I have to have many animation files, or just one with all the motions and your code just makes a "jump"?
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

I released a patch (source code) with it, but is not working with the latest SVN, been meaning to fix it (and does not include the changes to AnimatedMeshSceneNode)
http://irrlicht.sourceforge.net/phpBB2/ ... 8&start=60

Right now because it is in the b3d animater, it makes a jump as you say, and when I get it into the AnimatedMeshSceneNode I should be able to get it to work with many animation files too.
You could even have a static mesh (with bones) and make it animate based on other animation files that only have animated bones, and have still have transitions between them.

I try and release the source in a few days to a week, but it depends on how much free time I get...
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

Thank you. I will watch for the Project Announcements.

As i saw, yes, there is only the b3d stuff in it yet. Hope to hear from the .x version too :wink: :D

Anyway, I tried the patch. it should be my fault, that it didn't work I think.
What i did was:
- Downloaded patch.exe
- Put it into the irrlicht dir along with the .patch file.
- patch < b3dLoaderFixes09Aug.patch
- and i got this:

can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: include/IAnimatedMeshB3d.h
|===================================================================
|--- include/IAnimatedMeshB3d.h (revision 146)
|+++ include/IAnimatedMeshB3d.h (working copy)
--------------------------
File to patch:


Is this because of SVN? Or my fault? :oops:
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

I’m not sure why you get that error I use TortoiseSVN, I’ll have a look at it when I get home.

Anyway I’m making progress with it, I fixed a few bugs last night.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Use the correct dir (the main directory, not source/Irrlicht !!) and maybe add -p0 --binary to the command line options.
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

My mistake. I was in the correct dir, but used -p1 instead of -p0.
Sorry. This was the first time I used patch.exe

Now I've got it. I did it.

Thx
Post Reply