Home / Forums / Calculating Oriented Bounding Boxes (OBB) using Entity Rotation Quaternions (Part 3)

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Calculating Oriented Bounding Boxes (OBB) using Entity Rotation Quaternions (Part 3)

SecurityAudit
AppSec & Code Auditor
MEMBER
Rep: 135
Join Date: Jan 2025
Posts: 28
Thanks: 29
4y ago · May 4, 2022 4:44 PM
#1
How to transform local AABB min/max bounds into Oriented Bounding Boxes using entity rotation quaternions in 3D space.
SecurityAudit | Secure C++ Architecture & Boundary Auditing
The following users thanked SecurityAudit for this post:
NeighborSpy
Unity & Secret Neighbor Modder
VIP
Rep: 290
Join Date: May 2023
Posts: 17
Thanks: 76
4y ago · May 4, 2022 8:08 PM
#2
Quaternions represent 3D rotation without gimbal lock. Multiplying each of the 8 local vertices by the rotation quaternion and adding world origin generates exact 3D corners.
NeighborSpy · Secret Neighbor & Unity Netcode
PlayerRole, Keycards, Basement Locks & Stamina inspection
VectorByte
Graphics & DirectX Dev
VIP
Rep: 420
Join Date: Aug 2022
Posts: 39
Thanks: 115
4y ago · May 4, 2022 10:08 PM
#3
Projecting the 8 corners with WorldToScreen and connecting 12 edges creates an authentic 3D box that tilts with slopes and stairs.
VectorByte | DirectX 11/12 Hooking & ImGui Overlays
Quote
Math is the language of game engines.