Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Animation With D3DX9

This topic is 5459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am planning to store my levels and models for my games in .X files (however poor this may be) and use DirectX 9.0''s animation functions to extract and animate them. However, I have yet to find a suitable tutorial (even here on gamedev) on the subject, and the documention on msdn is very confusing. So far I have discovered this much: Call D3DXLoadMeshHierarchyFromX, which gives you a hierarchy of D3DXFRAMES, and an ID3DXAnimationController. Each Frame contains a MESHCONTAINER structure, which in turn contains materials and a mesh plus a SkinInfo interface to convert the mesh to a blended one, which in turn gives you BONECOMBINATION structs. *Phew* The AnimationController appears to have various methods for playing animations by setting the time and such, but I can''t quite figure it out. Do I have to render it myself or does the animation controller render the mesh for me when I call set time? Do I have to do something with those bone combos if I do have to? My main question is, considering I have an X file made, how do I load, animate, and render it using LoadMeshHierarchy. Example code would be greatly appreciated.

Share this post

Link to post
Share on other sites
The AC does not render the mesh for you. All it does is set animation sets into its tracks, set events for tracks, and set the time. Setting the time (SetTime(), or AdvanceTime() in the new beta) updates the matrices in the FRAME hierarchy. Those matrices are used to render the mesh, using the SkinInfo.

There will be better animation samples in future SDKs. I wish there were a good tutorial on it too. It works really well once it''s set up, and it lets you use pretty much any method of rendering.

I like pie.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!