   Linkage between ID3DXAnimationController, d3dxframe and animationsets
  I want to know that how does the animation controller decides that matrix calculated from animation set is to be applied on which frame i.e. how does the controller knows on which bone a particular matrix calculated from the animation set is to be applied.   
  It depends how you created your animation controller. Most people don't create one by hand - they use this API: D3DXLoadMeshHierarchyFromXInMemory().Behind the scenes this API will find all the named frames in any animation sets specified in your X file in the hierarchy of D3DXFRAME structs that is also created. It creates a table of pointers to each of your skinned meshes D3DXFRAME's transformation matrices and that is used by the ID3DXAnimationController during the AdvanceTime call when it goes to update the matrices.I have noticed the following things myself:#1. ID3DXAnimationController::AdvanceTime() only updates the TransformationMatrix of D3DXFRAME's that were called out in an AnimationSet in the X File. If the "hierarchical scene graph" of the character has frames with duplicate names the first one is used which may cause artifacts. Also if the AnimationSet specifies a frame whose name cannot be found in the hierarchy I have crashed in d3d9.dll IIRC.#2. The TransformationMatrix isn't reset from animation frame to frame - it just keeps accumulating the keyframe transformations into it. If your animations aren't setup to handle this you will need to perform a pre-pass over your skeleton's hierarchy to reset its TransformationMatrices to "bind" or OriginalMatrix values *BEFORE* you call AdvanceTime on the animation controller. This would be necessary if the keyframe transformations specified ABSOLUTE rotations or translations at time T rather than DELTA rotations or translations. Most keyframes that I've worked with specify ABSOLUTES from bind.#3. You can create this linkage manually if you didn't use the D3DXLoadMeshHierarchyFromX() et al APIs. The trick is ID3DXAnimationSet::RegisterAnimationSRTKeys().   