Find the 3D bounding box of a mesh
Is there a built-in method for getting the 3D bounding box of a mesh? I am manually placing nulls and measuring distances, but it's kind of a pain to make the nulls for every object I want to measure.
Best Answer
-
Hi! Yes! On the RenderMeshVisual component of the mesh, you can get the local and the world bounding box positions using
localAabbMin(), localAabbMax() and worldAabbMin(), worldAabbMax()
https://docs.snap.com/api/lens-studio/Classes/Components/#RenderMeshVisual--worldAabbMin
1
Answers
-
Aha! I did know about those properties but it didn't click in my brain. I sort of just ignored those because I was like "those are for physics calculations." Thanks for pointing them out for me!
Anyway, the manual positioning of nulls give an interesting control mechanism for defining padding, which I kind of like.
0