glTF2 animation postion issues (which I can't solve for the last 8 months)

Hello!

I’m currently working in implementing animations for a simulator I’m currently working on. However when I import my tram model (which in every other 3D visualizer behaves properly) one of the doors is slightly incorrect.

I’ve tried:

  • Debugging it on my own using logs and RenderDoc - the matrices seem fine and I’ve found the place which (I think) is causing this
  • Asking experts in my educational institution and on some universities around town
  • Asking on multiple forums, sadly to no avail
  • Analyzing stuff (both code and logs) using AI - but this has only made things worse
  • Asking my math-oriented friends
  • As a last resort: poking at some random piece of the code and changing them a bit

What I’ve found:

  • The issue is somewhere in bone matrices - before applying any animation the second doors are already wrong (see fig. 3)
    • Model.cpp file has the issue: either somewhere in the Model::Model(const std::filesystem::path& aPath) noexcept constructor or the getNodeJointAmount, getNodeJointOffset, getNodeMatrix or updateJoints methods of the Model class
    • GL3D.cpp, Animation.cpp and Mesh.cpp are correct and work
  • Animation calculation is completely fine - even the “bad” doors move correctly relative to themselves
    • Tried disabling it (which did not change anything about the issue), analyzing - everything is fine
  • Model loading is fine - the base model is rendered correctly (the second doors are correct too)
  • This is not a hardware bug or OS bug (X/Wayland also behave the same, so do Intel/AMD/Nvidia cards and Windows/Linux)
  • This is not a Blender bug - other online GLTF visualizers all show everything properly
  • This is not a shader issue - they are copied from the reference
  • Matrices in RenderDoc and the logs do not look corrupted or weird
  • Projection matrices are not the issue - same happens on perspective/ortho
  • Not an integer overflow - when I isolate the doors (model T3dvere.glb on GitHub) it still fails in the exact same way
  • Not an issue in GLM or fastgltf

All of the other animations and other models I got working (except for the ones where I explicitly don’t support some feature).

The whole code, together all of the packaged models, is available on GitHub: MegapolisPlayer/GLTFAnimationSample The 3D model was modelled in Blender 4.

I’ve been trying to solve this (albeit on/off, not constantly) since February this year. Any help would be REALLY appreciated. I expect there to be some miniscule issue which I’ll feel extremely embarrassed for…

Additional photos since new accounts cannot add more than 1 embedded item.

And another one. Anti-spam regulations are impotant but in the interest of solving this quickly I do have to work around this a bit…