   Key Frame animation
  Hi,Ok I am studying how the keyframe animation works and I need some clarification.So far I understood that for a keyframe animation system you need :1)A skeleton with bones2)An array of keyframes3)An interpolation method (linear at the beginning at least)Now..where can I find a file with some keyframes inside?I'have been playing recently with some motion cature files(acclaim or bvi) with keyframes but as far as I understood such files contains all the frames of the animation and not only a few that I need to interpolate, is this correct?cheers,shezad.
Quote:Original post by shezadas far as I understood such files contains all the frames of the animation and not only a few that I need to interpolate, is this correct?Yes and no. Such files do contain high frequency frame data so it isn't essential to perform interpolation to get a half decent motion. For best results, though, it is still better to interpolate (linearly) between those frames.   ;Quote:Original post by dmatterQuote:Original post by shezadas far as I understood such files contains all the frames of the animation and not only a few that I need to interpolate, is this correct?Yes and no. Such files do contain high frequency frame data so it isn't essential to perform interpolation to get a half decent motion. For best results, though, it is still better to interpolate (linearly) between those frames.So for example I could parse an acclaim motion capture file and instead of playing every keyframe I can interpolate between two of them getting a better result?If this is correct I can find a lot of models online saved in acclaim format and I could speed up everything.Cheers,shezad;  Should I use a bva or acclaim keyframes file?I ask this because so far I've seen that the time inside a keyframe is important for a correct iterpolation, the acclaim motion captured file has no time while the bva has this value.;Quote:Original post by shezadSo for example I could parse an acclaim motion capture file and instead of playing every keyframe I can interpolate between two of them getting a better result?That's right. A typical frequency for frame samples might be 30fps but some people might be able to notice the 'jitterines' of the animation even at that speed, also you might not even want to play it back at full speed, you might want to play it in slow motion in which case even more people will be able to notice the popping effect of each frame coming in if you don't interpolate.Quote:If this is correct I can find a lot of models online saved in acclaim format and I could speed up everything.Not just acclaim though, free tools such as Blender can import and export between a number of formats, you could convert mocaps from other formats (or even artist-created animations) into acclaim or some other common format of your choice for your program to load. I can't tell you off the top of my head which formats Blender supports though, it's not even installed on this machine.Quote:Should I use a bva or acclaim keyframes file?I ask this because so far I've seen that the time inside a keyframe is important for a correct iterpolation, the acclaim motion captured file has no time while the bva has this value.The frame-time is important to playback the animation at full-speed, i.e. the speed at which it was recorded at. Playing it back at a different rate would speed up or slow down the animation. BVA and BVH formats explicitly define the frame-time, those formats which don't require you to either know the frame rate already or tune an arbitrary frame rate that 'looks good'. A common and sensible default to try is 0.033333 seconds per frame (30 frames per second).As for deciding on which one to use well it really doesn't matter too much. In my animation system (see my signature) I used the BVH format (successor to BVA) for their dead simple specification. The reality of the situation though is that most popular mocap formats suffer some drawbacks. BVH/BVA don't have decent headers, there's a lot of information they don't give you such as the point of origin, the number of joints to expect, etc. It's also worth pointing out that some formats work in terms of joints (BVA/BVH) and others in terms of bones (asf/amc) so you might have a preference there. My advice is therefore to pick one and go with it, if you choose a general enough representation in code then writing another loader at a later date shouldn't be a difficult task at all.   ;  So I think I will pick up the acclaim file because I am already writing an importer and I will try to display the skeleton at the beginning without skin.Do you have any good document, tutorial or book about skeletal animation?I think the most difficult part is to understand how to get the matrices required for the animation of the bones (from root to children).cheers;Quote:Original post by shezadDo you have any good document, tutorial or book about skeletal animation?Not especially I'm afraid. A look through some old bookmarks uncovered this and although I can't say it's the best implementation I've seen the explanation is half decent. I also have this, written by my old supervisor, again not the best implementation but it explains the maths theory and there's a full implementation at the end to at least see how that maths is rendered in code, it doesn't cover Acclaim specifically though unfortunately.Quote:I think the most difficult part is to understand how to get the matrices required for the animation of the bones (from root to children).That's not too hard. For each frame the format specifies the transformation of each bone in bone-space as a series of rotations/translations through various degrees of freedom; the easiest way to get those as a single matrix is to convert each transform into a matrix (e.g. xrot, yrot, zrot) and concatenate (multiply) them together (in the order specified in the file!), the result is a matrix that represents the transformation of a single bone in its local space. Once you have that for each bone then you can traverse the hierarchy, starting at the root, and multiply up the matrices to get the world-space transform of each bone; specifically: The world-space transformation of a bone is the product of its matrix with the product of all the matrices of its parent bones up to the root.   ;  Ok thank you very much expecially for the second pdf, I will certainly read it.So now my objective is to play a motion capture file just to understand how everything works, I will add vertex skinning later and at the end I will make my custom animation file.Does everything sound good to you? :)Cheers   ;  Sounds fine to me [smile]. Don't feel you *have* to make a custom file format though, the major benefit to using existing formats is that it's already widely supported but then I don't know what your reasoning is for doing it so maybe you're justified.   