how to scale GLTF model in threejs, doesnt seem to work

Viewed 678

I cannot seem to resize the mesh loaded as GLTF, seems like only the root is resized but not the child, how should I resize the mesh from its root to its child.

This is what I tried so far

loader.load('assets/a1-experiment/A1.glb',
     (gltf) => {
        ...
        gltf.scene.scale.set(0.001, 0.001, 0.001);
        ...
     });

It doesn't seem to work. Any other idea?

1 Answers

GLTF.scale.set sets the scale to a certain size, not caring about original sizes. This means that you need to do:

loader.load('assets/a1-experiment/A1.glb', function(gltf){
    gltf.scene.scale.set(.001*gltf.scene.scale.x, .001*gltf.scene.scale.y, .001 * gltf.scene.scale.z)
}
Related