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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help