Skip to content
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

Bounding Box #54

Open
giuliobrugnaro opened this issue Jul 10, 2019 · 2 comments
Open

Bounding Box #54

giuliobrugnaro opened this issue Jul 10, 2019 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@giuliobrugnaro
Copy link

Hello,
I would like to load assets (.stl files) uploaded by users (so the origin of the file might not coincide with the centre of the mesh object): Is there a way to calculate the Bounding Box of a mesh (or more meshes ideally) and set its center as the target for the ArcRotate camera?

In BabylonJS I would use something like: mesh.getBoundinfo().boundingSphere.centerWorld

Thank you!

@BrainBacon
Copy link
Collaborator

Hi, sorry this is late, could you prepare a minimally reproducible example on Glitch or something similar? Here's a starter example on Glitch.

@BrainBacon BrainBacon added need repo The issue should have a minimum reproduction example good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested labels Jul 17, 2019
@giuliobrugnaro
Copy link
Author

Hi @BrainBacon, I was not able to get it working in Glitch but I have created a reproducible example and upload it here: https://github.com/gggggbbbbb/vue-babylon-test . In this example you can clearly see how the target ArcRotate camera does not correspond with the "center" of the displayed object (calculated from its bounding box) but rather with the global origin of the STL file loaded (which could be arbitrary).

@BrainBacon BrainBacon removed the need repo The issue should have a minimum reproduction example label Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants