A Couple 3D AABB Tricks
gpfault.net·4d·
🎨Graphics Programming
Preview
Report Post

published on Dec 23 2025

Axis-aligned bounding boxes are ubiquitous in 3D programming, typically used as stand-ins for some other shape (for example, for purposes of collision detection or determining visibility). The main characteristic of an AABB is that it is, well, axis-aligned: its sides line up with the coordinate axes. Over the years I’ve encountered a couple useful tricks for working with them that I want to share here. None of these are new.

AABB Representation

The first trick has to do with AABB representation. In some learning materials, I’ve seen AABB represented as a point (usually the centroid) plus the dimensions of the box:


struct aabb {
float centroid[3];
float width_height_depth[3];
};


Sometimes the width/height/depth are stored divided by 2, …

Similar Posts

Loading similar posts...