OpenFBX icon indicating copy to clipboard operation
OpenFBX copied to clipboard

Some meshes are not correctly loaded

Open mixern6 opened this issue 3 years ago • 0 comments

Hello everyone, I'm trying to implement FBX loader in my project. I already implemented glTF loader and it works just fine, but with FBX I get strange result for some models. Here is an example of one such model: model 50005011.zip What I do:

  • For each node I use ofbx::Object::getLocalTransform() without any extra processing. As you can see on the image the skeleton is correct.
  • Each vertex I multiply by ofbx::Mesh::getGeometricMatrix() and that is enough for most models, but not for the attached one.

If I put the mesh to it's bind pose, it looks like this: model2 To make the model look correct it is enough to cancel the 90deg rotation, but where it comes from...

UPD If I make changes to make it like in LumixEngine, then I get correct main mesh of the model, but the sword and other models are loaded with deformed meshes:

  • I set (globalTransform * geometricTransform).inverted() to mesh nodes instead of local transforms;
  • I multiply vertices by (globalTransform * geometricTransform), which doesn't make sense to me but somehow it fixes the main mesh.

Yet I still don't understand how to make all models load properly.

mixern6 avatar Aug 12 '22 13:08 mixern6