Hi,
I have 3 different 3D Models with different scale. Each model is assigned to a button and the model gets instantiated when the button is clicked. How do I avoid models getting instantiated with different size/scale.
You could get the bounding box of all 3 models, then compare their size with Box3.getSize()
var box = new THREE.Box3();
var size1 = new THREE.Vector3()
var size2 = new THREE.Vector3()
var size3 = new THREE.Vector3()
box.setFromObject(obj1).getSize(size1);
box.setFromObject(obj2).getSize(size2);
box.setFromObject(obj3).getSize(size3);
// Now access .x, .y, .z to get width, height or depth.
console.log(size1.x);
console.log(size2.x);
Once you know their width, depth, or height, you could compare their dimensions and scale them down. It’s up to you to determine if you want to compare by width, depth or height.
2 Likes
And as an addition: Does Three have any kind of independent unit? I understand that a unit in Three is abstract, but scale.set seems to be relative to the models imported size - #4 by prisoner849
1 Like
Thanks for your help, it’s working!