Currently, I am aligning objects/models (mesh) in my scene by using the mesh.geometry.center()
function.
This method helps position the object in the center based on its bounding box.
For static objects with a fixed size, like a cardboard box for example, this approach works perfectly without any issues.
However, when dealing with more intricate 3D models such as a bowling ball, jagged rocks, and the Eiffel Tower, the current method falls short. These detailed models end up being centered based on their overall shape which can lead to parts of the model protruding or floating awkwardly in space.
I am looking for a way to determine the center of each mesh only along the X and Y axes. This would allow me to place these complex models flat on an XY plane seamlessly without having to manually adjust the Z value. Is there a solution for this?