This project is read-only.

model animation

Sep 21, 2011 at 8:44 AM

Hi, i need some help on adjusting the goblin code. The reason is when i run  my .fbx model in tutorial 14, the model animation some how look like it have been offset.

http://www.youtube.com/watch?v=bhvjQq3GyX0

 

But when i run in SkinningSample,  the animation run normally.

Coordinator
Sep 22, 2011 at 3:31 AM

how does it look with SkinningSample?

Ohan

Sep 22, 2011 at 5:57 AM

hi ohan,

Thanks for the reply.

In SkinnedModelExtensions_ARCHIVE_3_1, my model run properly without any animation problems.

http://www.youtube.com/watch?v=OSpxEu2aU1Q

Sep 25, 2011 at 10:01 PM
Edited Sep 25, 2011 at 11:40 PM

Hi com97779!

I found the same problem when i use Blender to make the models.

This is because you have moved your root bone in your animation process.(sorry the poor english).

I see that your model open and close the eyes and still moving your legs.

I guess Goblin apply the vectors and matrices in the root bone (making this 'fixed', and performing all bone animations around it).

If you translate or rotate the root bone, Goblin will make him at 'zero' position and animate all the other parts around it.

I guess Xna uses a little diferent way to perform this. If you take a look in tutorial 14 you'll see that the Dude model have this behavior too but less than your pet. (see Dude body's in tutorial 14 and in SkinningSample). 

To solve this, you have to reanimate the dog leaving the root bone untouched without scales, translations or rotations of any kind, extending a conection like a 'tail' to your model, and animate him, but again, leaving the root bone at 'zero' position.

This works for me and i really hope that this helps you.(sorry the english again)

 

Eduardo.

Coordinator
Sep 26, 2011 at 7:40 AM

Thanks for the pointing Eduardo. I actually intended to make it work the same as the XNA SkinningModel sample program, so if it behaves differently, then it's Goblin's fault. Since I don't have time to take look at the problem and fix it, it'll be great if someone can post a fix here that makes Goblin behave the same way as the XNA sample program. I believe the fixes can be done within the Tutorial 14. If not, it's going to be a harder problem.

Ohan

Oct 4, 2011 at 3:23 PM
Edited Oct 4, 2011 at 3:26 PM

Hi!

In the AnimatedModel class, in the render function :

foreach (ModelMesh modelMesh in this.mesh)           

{               

Matrix.Multiply(ref transforms[modelMesh.ParentBone.Index], ref renderMatrix, out tmpMat1);

If you change  'modelMesh.ParentBone.Index' code to 'modelMesh.ParentBone.Children.Count', Goblin will handle the models without this behavior.
But i only have tested this with the fbx Dude, 'Player Marine' and 'EnemyBeast' (models from XNAnimation library), since i have made all my models in Blender (2.49b) to work with the original configuration.

This change don't work with the Tiny.X, i don't know why. 

The Softimage Mod Tool 7.5 also have a set of functions specially designed to XNA that works perfectly to Goblin.  But is free just to non commercial use.

I don't think this is Goblin's fault, Ohan, this way to handle models by the rootbone makes perfect sense to me.

Thanks for your attention.

Eduardo. 

Coordinator
Oct 4, 2011 at 7:19 PM

Thanks Eduardo. I will take look at your suggested solution sometime soon. I've never made an animated model myself, so I never really tested the animation code much with other than the Dude model. It's good to hear you have tested the code with other models, and we appreciate for the information regarding which modeling software to use.

Ohan

Oct 7, 2011 at 8:18 AM
Edited Oct 7, 2011 at 9:31 AM

Thanks ohanoda and Eduardo for the help. Your comment helped me with the animation. Now 13 out of 17 model animation is work fine.