How to scale ImportMesh gltf model

Hello all,

I’ve been attempting to scale a model that I imported however it doesn’t seem to be working. The model doesn’t scale at all regardless of what number I set using scaling.

Here is a playground with my attempt and another method I tried also:
https://playground.babylonjs.com/#MG0KG4

Any help greatly appreciated. Thank you.

Hello and welcome!

Here is more correct example - https://playground.babylonjs.com/#DYWXUX#1
I put the 1 unit size box to have the visual reference of scaling.

The line
meshes[i].scaling = new BABYLON.Vector3 (3,3,3);

means that you scale every mesh from your model with x,y,z axis, with multplier 3.
For only one axis you may use, for example
meshes[i].scaling.x = 3;

Also note that usually you don’t need to create canvas or render loop etc when you use Playground - it has all you need already by default, so you can concentrate on createScene function. When you download your scene, all other needed functions will be added to your .zip file.

3 Likes

Thank you so much. Works great.