Animating components of a 3D Model

Not entirely sure where to put this, so I’m dropping it in General, I’m sure a kind-hearted mod will move it if that is a bad decision.

I’m kind of wondering about what the standard ways are to animate things that are attached to models - armour, weapons and other visible equipment, for example. I’m not really thinking of anything platform or engine specific, just the general principles and usual ways it’s done. A good example might be having an RPG character with a sword- when they are moving around, it is scabbarded at their hip, when they are in combat the sword is drawn and swung around by the character. In a typical RPG you might have 10 different types of sword, all of which share the same set of animations. The character animations are obviously being created in the modelling program, but how is the weapon connected to them? Presumably there isn’t a separate set of animations stored for the character with every possible combination of equipment - does each bit of equiment have it’s own frames of animation matched to those of the character (again sounds very complex to create) or is it connected to the character in some way?

I’m not quite onto working with this problem, but I will be at some point fairly soon and as I’m sure it’s been solved numerous times before I figure it’s probably easier to ask before I start barking up all the wrong trees…

Your thinking of good 'ol fashioned keyframed animation. Which sucks big time for that kind of things.

What would be better for the scenario you get is skeletal based animation. You would create a dummy bone that doesn’t affect any vertices on the model itself, then when your holding a weapon or something, you would set the weapon’s position and rotation to be that of the dummy bone. I think thats a fairly good solution. The weapon itself can have an animation too, but would be best for this scenario if its origin didn’t change (i.e the point at which the sword is attached to the dummy bone, imagine the reloading of a weapon)

DP

So you animate the skeleton as usual and then import the lot into the 3D environment and use the animations directly?

I can kind of see that is a smart way of animating the scene actually, especially the ability it gives you to actually mess around with skeletons from code. For some reason I was figuring that key frames would be easier, probably because it’s a technique I’ve used before…

skeletal animation is used all over the place for characters now. The one name that jumps out is Doom3 with their Md5 format which is a skeletal format.

Its more complicated than that. You generally have a base skin and every vertex has a “weight” associated to it, this weight is the influence of bones on that vertex. You then move the bones using your animation files or whatever, then “skin” the mesh. Just google for “skeletal animation”, that should give you a better insight.

DP

Anyone knows if they are and which are the skeletal anim systems in Java ?
Say, is there a Cal3D equivalent in Java ?

there is a cal3d plugin for jme at http://gamedev.kproject.gr