You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GLTFLoader doesn't update bone world matrices after a model loads (see mrdoob/three.js#24772) which means the SkinnedMesh.computeBoundingBox() call within Box3.expandByObject() can result in an incorrect bounding box.
A workaround is to call .updateMatrixWorld() on the object before calculating the bounding box.
Three.js r151 introduced bounding volumes for SkinnedMesh, see mrdoob/three.js#25612. This causes unexpected behavior with
Box3.setFromObject()
Take for example this model: bobby.glb.zip
GLTFLoader doesn't update bone world matrices after a model loads (see mrdoob/three.js#24772) which means the
SkinnedMesh.computeBoundingBox()
call withinBox3.expandByObject()
can result in an incorrect bounding box.A workaround is to call
.updateMatrixWorld()
on the object before calculating the bounding box.three-gltf-viewer/src/viewer.js
Lines 251 to 257 in 83114d4
+object.updateMatrixWorld() const box = new Box3().setFromObject(object); const size = box.getSize(new Vector3()).length(); const center = box.getCenter(new Vector3());
The text was updated successfully, but these errors were encountered: