Skeletal Animation questions

Started by
5 comments, last by Kent767 19 years, 12 months ago
Ok, I'm just getting started on another side project. I'm using OpenGL, and basically looking for an effective way to accomplish the task of skeletal animation. What seems to make my situation different is this. I plan on using a seperate model for each section of the model. I.e. There will be a Head model, a hand model, a foot, leg, etc. Each section of the model will need to be attached to the skeleton at run time. (basically the game allows for an infinite combination of physical traits when developing your character, this flexibility is something that drives the gameplay as well) Does anybody have some decent tutorials on how to accomplish this. It seems like the majority of the ones i've seen use milkshape model formats, and it appears that the skeleton information is stored IN the model format. Which I'm going to need something more along the lines of a seperate skeleton file itself. Thanks, Kent

#include <stdio.h>  
 #define print printf  
 #define caller void main(){  
 #define ref }  
  
 caller ;  
 print ("Hello World!\n");  
 ref;
  
[edited by - Kent767 on April 20, 2004 1:33:05 PM]
--------------------Kent's Amazing Cross Compilable Hello World Program!#include #define print printf #define caller void main(){ #define ref } caller ; print ("Hello World!n"); ref;
Advertisement
Apparently some modelling programs will allow you to export the skeleton as its own model, so perhaps it is feasible, has anybody had any experience in doing work like this?


Kent
--------------------Kent's Amazing Cross Compilable Hello World Program!#include #define print printf #define caller void main(){ #define ref } caller ; print ("Hello World!n"); ref;
Kent gave the basic answer: consider the skeleton a different object. Have a way of ID''ing the different bones. Export the skeleton with any necessary information, e.g. hierarchy information, default transforms, IK constraints, etc. At run time, make an instance of the skeleton. Instance & attach the objects to the individual bones/nodes using the ID''s you stored.
Oops. Kent, I never even looked to see that you were the original poster. But, yeah, you figured it out.
Personally, I use Blender which provides a Python scripting interface. You can write your own exporter which can export the skeleton separately. The Cal3D project includes various exporter scripts (check the Cal3D Exporters download section) including a Blender script which exports animation and bone data. Download the script and take a look to see what it does if you like.


[edited by - VertexNormal on April 24, 2004 12:44:03 PM]
Programs like Milkshape are a great way to get started modelling and animating characters using existing formats. When you need to do something a bit more complicated, it begins to get frustrating. The key thing here is to realize that skeletal animation is made up of multiple parts:

The hierarchy - this represents the relationship of a child bone and it''s parent. If you have access to 3D Max or just browse the character studio web site you can see they have a biped rig which shows this pretty well.

The bones - the bones in the hierarchy are represented as rotation, scale and translation with repsect to their parents. It''s the movement of these bones that defines animation data.

The skin - the geometry attached to the bones - in a skinning situation that supports non-rigid weighting you assign vertices that are effected by the position of the bones.

In all the animation systems and skinning code I''ve written or been involved with the two parts of the process are seperate. The hierarchy and the animation data are handled by an animation system. Once the skeleton is posed for the frame it is passed off to a rendering system. The rendering system decides what to do with it. There''s nothing that says that the posed bone data will be used for a single mesh. It could be used to pose multiple meshes. With skinning geometry, because the artist specifies which vertex is weighted to which bone, you could easy have a mesh that is ONLY the head weighted to the head bone, with some blending to the next, and on to arms that are weighted to only the arm bones. The problem comes when you need to attach the different meshes so that there are no seems. In these cases you may need to combine your meshes before hand (at run time, only once per change in the permutation, say ) and do some cleanup to essentially weld the vertices together. Some games do this by having ''mating rings'' or specific vertices that MUST be placed in the same place on each arm top and bottom, say, and must be the same size and weighting so that hands match to arms and all that.

I''m not sure of the best way to author this content. Our studio is a 3D Max shop and I wrote the exported myself for outputing skeletal animation data as well as the skinning information. If you are doing fully rigid weighting (no blending of multiple bones per vertex) I suppose you could just get the bone positions and draw your arms in their place, but the first step I would go to is getting a skeletal animation system running that is independant of the geometry you are going to drive - draw all your bones as points, or line segments, or some such.

Hope that helps.
Thanks for the replies you really helped clarify the concepts well.

I doubt I will get into welding vertices and such, I''ll probably just have the content for each object created as a closed object, so there would be some seams, but that is not completely horrible.

Kent
--------------------Kent's Amazing Cross Compilable Hello World Program!#include #define print printf #define caller void main(){ #define ref } caller ; print ("Hello World!n"); ref;

This topic is closed to new replies.

Advertisement