What's the difference between BoxHelper and Box3Helper?

BoxHelper “uses Box3.setFromObject to calculate the dimensions”, so I feel that it just requires creating one less box3, if I want to present a mesh.
I wonder what are the specific use cases for them.
BoxHelper.update() is so clear in the document, while I still haven’t figure out how to update the Box3Helper. I guess it’s Box3Helper.updateMatrixWorld() but can’t find any example.

Like mentioned in the documentation, Box3Helper is intended to visualize an instance of Box3 which is essentially an AABB.

BoxHelper instead is intended for instances of Object3D that have a geometry assigned. The helper visualized the corresponding AABB.

Yes, the code is somewhat redundant. If you work primarily with objects, use BoxHelper.

2 Likes

hi,why is there some models whose BoxHelper does not fully enclose the model?

Do you mind sharing one of these models?

Uploading: 1.0风格女5.glb…
Sorry to reply you so late. By the way, how can I center this model automatically? Because I’m doing a function that dynamically renders different models.

You have not uploaded your model correctly.

Try this: Is there a tool for centering GLTF models? - #2 by donmccurdy

I use the fitToBox method of the camera-control plugin to center and scale the different models automatically. Can you tell me how to adjust the abnormal model like this?

I use the fitToBox method of the camera-control plugin to center and scale the different models automatically. Can you tell me how to adjust the abnormal model like this?