I use code like this:

```
public get boundingInfo(): Nullable<BoundingInfo> {
if (!this.rootMesh) {
return null;
}
// meshes are already parented to root mesh, so we do not need to look further.
let min: Nullable<Vector3> = null;
let max: Nullable<Vector3> = null;
this.rootMesh.getChildMeshes().forEach(childMesh => {
const { minimumWorld, maximumWorld } = childMesh.getBoundingInfo().boundingBox;
if (min === null) {
min = minimumWorld;
} else {
min = Vector3.Minimize(min, minimumWorld);
}
if (max === null) {
max = maximumWorld;
} else {
max = Vector3.Maximize(max, maximumWorld);
}
})
if (min !== null && max != null) {
return new BoundingInfo(min, max);
}
return null;
}
public scaleTo(maxDimension: number): void {
const boundingInfo = this.boundingInfo; // will be null when no meshes are loaded
if (boundingInfo && this.rootMesh) {
const longestDimension = Math.max(
Math.abs(boundingInfo.minimum.x - boundingInfo.maximum.x),
Math.abs(boundingInfo.minimum.y - boundingInfo.maximum.y),
Math.abs(boundingInfo.minimum.z - boundingInfo.maximum.z)
);
const dimension = maxDimension / longestDimension;
this.rootMesh.scaling.scaleInPlace(dimension);
this._scaledToDimension = maxDimension;
}
}
```

For a .obj I create a root mesh, which is just a transformNode or empty mesh and then parent the ones that aren’t parented. Something like this:

```
let rootMesh = new AbstractMesh(sceneFilename + "-root-model", scene);
modelMeshes.forEach(mesh => {
// leave meshes already parented to maintain model hierarchy:
if (!mesh.parent) {
mesh.parent = loadedModel.rootMesh!;
}
})
```

So, what that code does is scale the mesh to, for example, 2 at the most and maintain aspect ratios.