nem0 / OpenFBX

Lightweight open source FBX importer
MIT License
1.15k stars 135 forks source link

Some meshes are not correctly loaded #76

Closed mixern6 closed 2 years ago

mixern6 commented 2 years ago

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:

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:

fbxloader.zip I think I miss something in FBXLoader::loadMesh

mixern6 commented 2 years ago

I solved the problem. Local transform should be used for mesh nodes. The mesh itself should be multiplied by: (globalTransform * geometricTransform) if it is skinned. geometricTransform if it is not skinned.