I have a group with a bunch of InstancedMeshes that I’m trying to center on the screen.
The thing is, even after I change the position of each the instances, the bounding box of the group doesn’t seen to change.
Snipet I’m using to center:
const boundingBox = new THREE.Box3().setFromObject(this.group); this.group.position.sub(boundingBox.getCenter(new THREE.Vector3()));
This does works, but the bounding box is wrong, thus the “centering” is wrong.
When I try to render the bounding box of the group with the following snipet, it shows as if the instances were not ever moved
const box = new THREE.BoxHelper(this.group, 0xff0000); this.scene.add(box);
BoxHelper of each InstancedMesh (apparently in the wrong position):