There seems to be a discrepancy in the proper usage of the Box3() getSize()
method, as discussed on various platforms including stackoverflow.
const geometry = new THREE.BoxGeometry( 10, 10, 10 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );
let cubeBoundingBox = new THREE.Box3().setFromObject( cube );
let boxSize = cubeBoundingBox.getSize();
console.log("BoxSize: " + boxSize);
Despite the guidance provided in the documentation and other sources, there seems to be an issue with the implementation of the code in this example.
Upon closer inspection of the three.js documentation, it appears that getSize()
should indeed be used as shown above. However, the code in the fiddle does not align with this approach. Could it be that I am misinterpreting the usage of
.getSize ( target : Vector3 ) : Vector3
? What could be the problem with the code in the fiddle?