How to resize gltf model under a maximum threshold

The gltf models I downloaded are either too big or too small,how can I set a maximum threshold for all of their size.
THX!

Hello,
you can try this :

  • scale down by factor of ten
object.scale.multiplyScalar(0.1); 

or

  • scale up by factor of ten
object.scale.multiplyScalar(10);

THX!I had tried this method a couple of sec age, But it didnt work.

For your convenience, Show my code as follow:

const loadGLTF = (path) => {
            return new Promise((resolve, reject) => {
              const loader = new GLTFLoader();
              loader.load(
                path,
                (gltf) => {
                 /* gltf.scene.scale.set(0.1) didnt work*/
                 /* gltf.scene is a Group class */
                 /* gltf.scene.children[0] is a 3DObject class */
                 gltf.scene.children[0].scale.multiplyScalar(0.1);
                  resolve(gltf);
                },
                // called while loading is progressing
                function (xhr) {
                  console.log(xhr.loaded / xhr.total);
                },
                // called when loading has errors
                function (error) {
                  console.log("An error happened");
                }
              );
            });
          };
....
 const model = await loadGLTF(
              "..../scene.gltf"
            );
normalizeModel(model.scene, itemHeights[i]);
const item = new THREE.Group();
item.add(model.scene);
item.visible = false;
setOpacity(item, 0.5);
item.name = itemNames[i];
items.push(item);
self.scene.add(item);

THX!

maybe you can try just : gltf.scale.multiplyScalar(10)

hhh, this still dosent work, object keep its original size

Can you please provide a live example Jsfiddle ? Thanks :slight_smile:

I tried as you recommend but nothing show up in the result.

Consider to use a similar logic like glTF viewers (e.g. https://gltf-viewer.donmccurdy.com/).

The idea is to center the model at the origin and then update the camera’s transformation and projection such that it nicely encloses the model. Study the following code for more details: