Skip to content

FBXLoader: Wrong transformation of child mesh. #22312

@avatar-studio

Description

@avatar-studio

Describe the bug

When loading some fbx files, the position of the second mesh is not correct.
In all programs except Three, the bow direction is normal.
However, in three, the direction of the rod of the bow is different.

To Reproduce

Steps to reproduce the behavior:

  1. Extract the attached zip file
  2. run index.html
  3. click 'load anim'

reduce code is below
001_fbx_load.zip

Code

// for load character
let loaded = await fbxLoad('./ArcherRi01.FBX');
loaded.traverse(child=>{if(child.isMesh) child.castShadow=true;});
loaded.getObjectByProperty("type","AmbientLight").removeFromParent();
loaded.getObjectByName("body").material.map = await textureLoad('./ArcherRi01.png');
loaded.getObjectByName("weapon").material.map = await textureLoad('./ArcherRi01_W.PNG');
scene.add(loaded);

// for anim
let animMixer = undefined;
let queue = false;
document.querySelector('[name=btn-load-anim]').addEventListener("click", async ()=>{
    if( queue ) return console.warning("already loaded animation");
    queue = true;
    let loadedAnim = await fbxLoad('ArcherRi@Idle01.FBX');
    animMixer = new THREE.AnimationMixer(loaded);
    let idleAction = animMixer.clipAction(loadedAnim.animations[0]);
    idleAction.play();
});

Live example

nothing

Expected behavior

Problems persist with animation

Screenshots

in other program
bug_1_other

in three.js
bug_1_three

Platform:

  • Device: [Desktop, Mobile]
  • OS: [Windows, MacOS, Linux, Android, iOS]
  • Browser: [Chrome, Firefox, Safari, Edge]
  • Three.js version: [dev, r???]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions