Sign in to follow this  
McBain

Need help with DX Animation library

Recommended Posts

I need some help in setting my animation library using DX animation library as a backbone. I'm using DX 9.0c. The goal: Use separate .X files for models and animations. The model file would be tiny.x with no animation sets. The animation files would be tiny_wave.x, tiny_walk.x, etc... The approach: 1) Load tiny.x model using the process used in SkinnedMesh and MultiAnimation samples. I'm only using fixed-function indexed skinning technique. This works fine right now with tiny_4anim.x file. So it's not a skinning problem. 1a) Tiny.x contains the frame hierarchy with FrameTransformMatrix, the mesh data, and the others, with no animation set data. 1b) Tiny_wave.x, tiny_walk.x, etc... contain the frame hierarchy with no FrameTransformatMatrix data and one animation set data. The frame hierarchy was needed for the file to be loaded. 2) After loading the animation-less tiny.x file, I load tiny_wave.x using D3DXLoadMeshHierarchyFromX. I'm using the same ID3DXAllocateHierarchy class as loading the model. Let's call the new animation controller, pTempAC, and the animation controller the model is using, pModelAC. 3) It seemed to load fine, so I'm requesting the animation set from the animation controller I got from the previous step. I register this animation set using pModelAC->RegisterAnimationSet(). And unregister pTempAC->UnregisterAnimationSet(). I set the track and enable the track correctly on pModelAC. 4) It seemed like it should work, but when I play the animation, nothing is moving. One debugging approach I tried to create a new ID3DXAllocateHierarchy that will not create new frames inside of CreateFrame(), but return the existing frame with the same name from the original model frame hierarchy. But this doesn't work because after the first frame, which is the root in all the cases, DX wipes out the siblings and children frame pointers. So the second time around, the root has no siblings or children. One thing I don't understand is how animation sets are associated with frames. Or even how animation controllers are associated with frames. Maybe I'm storing wrong type of data in my separated .X files. Got any ideas besides having all the animations in one file? There's a related thread, but not much help in depth. http://www.gamedev.net/community/forums/topic.asp?topic_id=217123&forum_id=10 Thanks in advance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this