I have a mesh of a house that I have loaded from a gltf file.
the house is not perpendicular to the world, so when i do a mesh.getBoundingInfo().boundingBox
the bounding box is larger than the square house.
How can I get a boundingbox that fits around the house even though it is rotated?
I had a though but I’m not sure on how to execute it.
The meshes that i’m working with are hitbox meshes which are simple boxes, but they are created in blender and exported as glb files. and their rotation is applied so I have no idea which orentation they have.
but my though is, since they are simple objects, and I only need to figure out the 2d footprint.
I could some how get a single face that is vertical
then get the normal of that face
then calculate the rotation of that normal against the world.
and then use that rotation to create the bounding box.
I’m really struggling with the math, and feel very lost
Do you think the flow above would be a possible solution?
and if so, where do I begin