How to scale a GLTF animated model

I have tried the below approach but it doesnt seem to work

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

here is the GLTF model:

https://drive.google.com/drive/folders/1tXTW57mrLBLQ3T2JzA2lXLQjPqO7dkpN?usp=sharing

Can somebody help or explain why?

1 Like

This works OK for me, you can test it by scaling the object in the editor here: three.js editor

Note that it will take a scale of 100x100x100 to make the object visible, it’s originally quite small.

thanks man, im not sure why i cant resize it on my code, anyways, if like in the case of a nested GLF meshes, if i scaled the root, does it scaled the other children as well right?

if i scaled the root, does it scaled the other children as well right?

It does! But note that (as far as I can tell) Box3.setFromObject(...) does not recompute all world matrices, so if scale on a parent has changed since the last time those were recomputed, you may need to use scene.updateWorldMatrix(true) on an ancestor first. The renderer will do this automatically each time it renders, beyond that you want to keep updates to a minimum for scenes with a lot of objects.

/cc

https://threejs.org/examples/misc_controls_transform

1 Like