Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using an animation from one mesh for another mesh

1 REPLY 1
Reply
Message 1 of 2
benjaminXK4KT
349 Views, 1 Reply

Using an animation from one mesh for another mesh

Hello,

 

I am working on a video game and its own game engine and I am adding support for FBX files. I am already able to load meshes, textures, materials and even animations. I got several different humanoid meshes and each of them has one animation stored in its file. I can load these files and render all meshes independently with their animation.

 

I do not have any 3D artist skills so I buy my assets from online stores or hire artists to create them for me. What I want to achieve next is to load animations from any artist and use them on any mesh. All animations are for humanoids and all meshes have humoid skeletons. My current problem is, how to map the animation from one mesh to another mesh?

 

As I learned from several forum threads, blog posts, articles and your SDK samples, this is the process for animating a vertex:

 

 

VertexTransformationMatrix = Inverse(pGlobalPosition) * lGlobalPosition * Inverse(TransformLinkMatrix) * TransformMatrix * GeometryTransform

 

 

My vertices are in Object Space. So first, I transform from my Object Space to World Space (TransformMatrix * GeometryTransform). After that, I perform a transformation from my World Space to the Bone Space by multiplying with Inverse(TransformLinkMatrix). Since I am in Bone Space now, I can multiply my actual animation, which is in Bone Space (lGlobalPosition). But since my mesh is in Object Space, I need to transform the vertex back from Bone Space to Object Space by multiplying Inverse(pGlobalPosition). Please note, I used the names pGlobalPosition and lGlobalPosition from the ViewScene sample (see FBX SDK Sample).

 

If I replace this sequence with the matrices I extracted from another mesh, the animation works, but the mesh looks oddly deformed. As far as I understood, the missing piece of the puzzle is to map between the Object Spaces of both meshes. I have one mesh from one artist, which has vertices in its Object Space. However, the second artist made animations on meshes in another Object Space.

 

My first question: Did I understood the problem correctly?

 

My second question: How do I map between the two Object Spaces?

 

1 REPLY 1
Message 2 of 2

Does no one have any idea how to solve this issue? I think it's a pretty common problem, right?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report