Description of the problem
In the latest version (r92) the stormtrooper collada model has an incorrect boundingBox.
I tried the BoxHelper:
const box = new THREE.BoxHelper(object, 0xff0000);
scene.add(box);
or a manual approach:
const boundingBox = new THREE.Box3().setFromObject(trooper);
const size = boundingBox.getSize();
const center = boundingBox.getCenter();
const geometry = new THREE.BoxGeometry(size.x, size.y, size.z);
const material = new THREE.MeshBasicMaterial({ wireframe: true, color: 0x0000ff });
const box2 = new THREE.Mesh(geometry, material);
box2.position.set(center.x, center.y, center.z);
scene.add(box2);
Both approaches result in the model not being in the boundingbox:
I already figured out that this started with r87,
r86 didn’t have this issue:
example code:
r86: r86...stijndeschuymer:bounding-box-test
r87: r87...stijndeschuymer:bounding-box-test-r87
I’m currently trying to figure out what causes this, but I’m quite new to three.js,
so I’d highly appreciate it if someone pointed me in the right direction!
Three.js version
- r92
- r87
- r86
Thanks! I checked #11991 but I still have issues trying to draw a boundingbox, I’ll move this to stackoverflow https://jsfiddle.net/66sor15y/4/