Home / Forums / Scaling 2D Bounding Box Dimensions dynamically from 3D Head and Feet Coordinates

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Scaling 2D Bounding Box Dimensions dynamically from 3D Head and Feet Coordinates

NullPtr_
Assembly & Engine Research
MEMBER
Rep: 260
Join Date: May 2023
Posts: 27
Thanks: 62
1y ago · Apr 10, 2025 11:33 AM
#1
Deriving bounding box height and width from head-to-feet distance with dynamic aspect ratio scaling.
NullPtr_ · 0xDEADBEEF was here
The following users thanked NullPtr_ for this post:
DarkLogic
Game Logic & SDK Developer
MEMBER
Rep: 180
Join Date: Jun 2024
Posts: 28
Thanks: 41
1y ago · Apr 10, 2025 12:51 PM
#2
Calculate feet and head screen positions with WorldToScreen, compute delta height = feetY - headY, and set width = height * 0.55f.
DarkLogic | Virtual method tables & SDKs
ApexPredator_
Source Engine Modder
VIP
Rep: 340
Join Date: May 2022
Posts: 23
Thanks: 88
1y ago · Apr 10, 2025 6:51 PM
#3
Adding an extra 10% vertical padding above the head position accounts for helmets and hats across different character models.
ApexPredator_ · Source Engine Specialist