Hello,
This is to inquire about an issue we are facing with Unreal Engine’s 3D bounding box representation, particularly when projected to 2D.
SETUP & TEST CONTEXT:
- We placed a skeletal mesh actor at the center of the scene and generated 60 frames by rotating the camera 360° around it.
- For each frame, we obtained the 3D bounding box using Unreal’s native methods (e.g.,
GetActorBounds()
), projected all 8 corner points into 2D space, and then constructed the tightest 2D bounding rectangle enclosing those 3D bounds points. - This 2D box is drawn in green in the attached visuals.
- The black box shown in the image represents the original 3D bounds as rendered or visualized directly from Unreal.
Issue: Bounding Box Appears Loose in 2D Due to 3D Plane Padding
In several frames (attached), we observed that the 3D bounding box appears significantly larger than the actor’s actual visible mesh, especially when viewed from oblique or edge-on angles.
Here’s a clear example, where frames from different camera angles are shown:
[Image Removed]
[Image Removed]
You’ll notice that although the mesh’s visible silhouette doesn’t change significantly, the green 2D bounding box width expands unexpectedly. This is likely because the 3D bounding box doesn’t rotate or contract based on camera view or visible geometry.
Observation:
We understand that the 3D bounding box may include planes that lie behind the legs or arms, and are generated in 3D space. However, when projected into 2D, they are leading to excess padding in the 2D space.
Queries:
- Is there a method in Unreal Engine to compute a tighter 3D bounding box that’s camera-aware frustum projection?
- If not natively supported, would it be advisable to compute such a bounding box manually using the mesh’s skinned vertices or bone locations, then projecting that?
- For static meshes, this is sorted by querying vertices and deriving min & max points to draw bounds. Still, is there a better way to do it as this method is computationally intensive?
- For skeletal meshes, even this method doesn’t help as animated vertices need to be extracted from skinned vertices.