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
Three.Box3.setFromObject and Three.Box3.setFromObject compute a bounding box of any 3D objects by searching for specific properties and recursively repeating the operation in the descendant of that object 1. For now, they produce incorrect results on SplatMesh or any objects with a SplatMesh in its descendant.
Those two method look for a property called boundingBox. When it's undefined, they assume the object have no bounding box, and try to use its geometry instead if it's null they suppose the object can compute its bounding box but does not have done it yet. As SplatMesh initializes its boundingBox to a new Box3(), those methods are unable to trigger the box computation and just use this empty box as if it was the correct value.
When they find a bounding box with a value "null", those methods call the computeBoudingBox method of the object with no parameter, then assume the boundingBox property of the object will be updated after this call. SplatMesh.computeBoudingBox do exist, but it does not update the boundingBox property of the mesh. That mean just setting the bounding box of a SplatMesh before using those methods won't make them work better.
Finally, when computing the bounding box of a composite object, those methods aggregate the bounding boxes of all its children together without applying any transform on them. They assume those box are all given in the global coordinate system. By default, the SplatMesh does not compute is bounding box in the global coordinate system.
The text was updated successfully, but these errors were encountered:
turien-pix4d
changed the title
Make SplatMesh compatible with Three.Box3.setFromObject / expandByObject
Could SplatMesh be made compatible with Three.Box3.setFromObject / expandByObject ?
Nov 7, 2024
Three.Box3.setFromObject and Three.Box3.setFromObject compute a bounding box of any 3D objects by searching for specific properties and recursively repeating the operation in the descendant of that object 1. For now, they produce incorrect results on SplatMesh or any objects with a SplatMesh in its descendant.
Those two method look for a property called boundingBox. When it's undefined, they assume the object have no bounding box, and try to use its geometry instead if it's null they suppose the object can compute its bounding box but does not have done it yet. As SplatMesh initializes its boundingBox to a new Box3(), those methods are unable to trigger the box computation and just use this empty box as if it was the correct value.
When they find a bounding box with a value "null", those methods call the
computeBoudingBox
method of the object with no parameter, then assume the boundingBox property of the object will be updated after this call.SplatMesh.computeBoudingBox
do exist, but it does not update the boundingBox property of the mesh. That mean just setting the bounding box of a SplatMesh before using those methods won't make them work better.Finally, when computing the bounding box of a composite object, those methods aggregate the bounding boxes of all its children together without applying any transform on them. They assume those box are all given in the global coordinate system. By default, the SplatMesh does not compute is bounding box in the global coordinate system.
Footnotes
https://github.com/mrdoob/three.js/blob/dev/src/math/Box3.js#L155 ↩
The text was updated successfully, but these errors were encountered: