Odd gltf model part orientation


I download several gltf models from sketchfab. Some of them have an odd display problem where the models hat is rotated 90 degree but the figure is not. Basically wizard stands upright but his hat is rotated, the brim sits on the head. It does show correctly in https://gltf-viewer.donmccurdy.com/ and in the gltf viewer addon to vscode. SO I am doing something wrong, no idea what. I load the scene, possibly with position.rotation attributes. I expect the entire model to reflect these, not part of it.

Any thoughts appreciated.

If the model appears correctly in viewers built with three.js, but not in your code built with three.js, then you will need to share information about how your code has been written for us to help.

I mainly wondered why a specific portion of a model, its hat, was obviously skewed 90 degrees. Are gltf models composed of parts?? If so, what sequence might I have done to screwup a portion of a model?

It should be noted that not all of the sketchfab models I use display this behavior.

I am using 115dev of threejs,
I use the GLTFLoader to load models into kind of a library
I use THREE.SkeletonUtils.clone to make a copy from my library.

I was thinking something your answer below was the issue.

@swift502 this isn’t a real fix of course, but as pointed out in mrdoob/three.js#18526, the following modification in threejs does seem to fix the animations:

const root = model.getObjectByName(‘root’); root.rotation.set(0,0,0);

!!#@@*** While looking for a response to dnmccurdy, I found a block of code that did not loop to affect all meshes in the gltf model…DANG my bad that for the help