I am facing an issue with the bounding box of a cube in my scene. The cube is being manipulated by the user using THREE.TransformControls
. After these interactions, I need to calculate the bounding box of the cube.
var test = new THREE.Mesh(new THREE.CubeGeometry(10,10,10), new THREE.MeshBasicMaterial());
scene.add(test);
test.geometry.computeBoundingBox();
var bb = test.geometry.boundingBox;
bb.translate(test.localToWorld( new THREE.Vector3()));
However, despite correct translation, the bounding box size remains incorrect. It always shows width and height as 10.
Is this a bug in the code or expected behavior? How can I accurately determine the bounding box of the cube after manipulation?