In our project, we have a tool to place the object on the “floor” which simply does the following.
let size = new THREE.Vector3();
let box = new THREE.Box3().setFromObject(selected_obj, true);
selected_obj.position.z = box.getSize(size).z * 0.5;
// (In our project axis are changed, the default UP is Z axis ( THREE.Object3D.DefaultUp.set(0, 0, 1) ) )
This feature seems to be not accurate after a rotation is made but I don’t know if I’m doing something wrong or I’m lefting some code after rotate.
In the following video I show you the real case. After doing the rotation, if I call the “floor” action, then is not correctly placed.
Which would be the best way to do this?