-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InstancedMesh bounding volume issue #25610
Comments
That's true but since these volumes are recomputed often, it's not required to have the best-fit volume. The performance of the computation is also important.
Do you mind explaining in more detail what you mean? The bounding volumes should be in local space. |
TBH, I don't think that best-fit bounding volumes which are more expensive to compute are necessary for view frustum culling and ray casting. You can always compute best-fit bounding volumes on app level if you need them. That said, it's sounds fine if you want to add "precise" support for |
yes, so I wasn't requesting compute precise volume by defaults, but requesting an option as if box3.setfromobject which defaults to false
nah, this will break codes; instancedmesh is-a object3d, behaviors had been defined in those apis |
It should work if you rewrite this section: Lines 162 to 175 in fbd3ef9
to something like: if ( object.boundingBox !== undefined ) {
if ( precise === true ) {
// best-fit AABB code goes here
} else {
if ( object.boundingBox === null ) {
object.computeBoundingBox();
}
_box.copy( object.boundingBox );
_box.applyMatrix4( object.matrixWorld );
this.union( _box );
}
} else { |
I don't think this a breaking change. The behavior wasn't right from the beginning. |
breaking change: from wrong to right. |
To sum up, there's still no out-of-box API computes the smallest bounding volume enclosing all instances, we've to impl on app level. Here's a good starting point (just appends |
Description
related #25591, its not guaranteed that the volume is the smallest, bc instancedmesh's matrixworld is ignored during
union
.could computeBounding*() offers "precise" like this -> https://threejs.org/docs/index.html#api/en/math/Box3.setFromObject
??
The text was updated successfully, but these errors were encountered: