Sign in to follow this  

Translate animated Meshes

This topic is 3730 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

Hi, I was wondering how animated meshes are rendered in Directx using X files. I found an article (http://www.toymaker.info/Games/html/load_x_hierarchy.html) which described how to load x files using the DirectX function D3DXLoadMeshHierarchyFromX. Now I'm wondering how I can move these meshes? As far as I understood the tutorial there is an D3DXMATRIX array of bone-matrices after the x file is loaded. What do I have to do to move this model along the different axis? Zerd *edit* Ok, now I read that the whole model will move if I translate the TransformationMatrix of the root frame. How could I miss that? But still I have the problem to translate the mesh. Here is what I do:
D3DXMatrixTranslation(&m_frameRoot->TransformationMatrix, ticks, 0.0f, 0.0f);
DXUTGetD3DDevice()->SetTransform(D3DTS_WORLD, &m_frameRoot->TransformationMatrix);

Any Idea what I'm doing wrong? [Edited by - Aquad on October 2, 2007 9:32:15 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Aquad
Any Idea what I'm doing wrong?


Yes, you're doing the programming equivalent of trying to run four consecutive marathons without ever having jogged a few laps around the track.

I say that because it sounds like you don't have an understanding of transformation matrices and how they work at all, but you're trying to render animated meshes which require a thorough understanding of transformation matrices.

Read Chapter 6. Vertex Transformations from my book. It will explain what you need to know about matrices and how to combine them.

Share this post


Link to post
Share on other sites

This topic is 3730 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.

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