Translate animated Meshes

Started by
0 comments, last by legalize 16 years, 6 months ago
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]
Advertisement
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.

My free book on Direct3D: "The Direct3D Graphics Pipeline"
My blog on programming, vintage computing, music, politics, etc.: Legalize Adulthood!

This topic is closed to new replies.

Advertisement