Developer knowledge network · moderated exchange

Супольнасць UnreliableCode

Супольнасць распрацоўшчыкаў даследаванняў, зваротнага праектавання і кадавання

Knowledge indexжыць
4Categories
919Threads
2.8KПаведамленні
Tutorial

ESP 3D Bounding Box rendering using GET_PED_BONE_COORDS natives

imgui_artisan
UI Designer
MEMBER
прадстаўнік: 202
Дата далучэння: Apr 2019
Паведамленні: 54
Дзякуй: 28
1 месяцаў таму · Jul 18, 2026 2:50 PM
#1

Rendering bone-accurate 2D/3D boxes over GTA V peds:

CPP
// Retrieve bone 3D world coordinates
Vector3 headPos = PED::GET_PED_BONE_COORDS(ped, SKEL_Head, 0.0f, 0.0f, 0.0f);
Vector3 feetPos = PED::GET_PED_BONE_COORDS(ped, SKEL_L_Foot, 0.0f, 0.0f, 0.0f);

Vector2 screenHead, screenFeet;
if (WorldToScreen(headPos, screenHead) && WorldToScreen(feetPos, screenFeet)) {
    float boxHeight = screenFeet.y - screenHead.y;
    float boxWidth = boxHeight * 0.55f;
    
    ImGui::GetWindowDrawList()->AddRect(
        ImVec2(screenHead.x - boxWidth / 2.0f, screenHead.y - 10.0f),
        ImVec2(screenHead.x + boxWidth / 2.0f, screenFeet.y),
        IM_COL32(0, 255, 128, 255),
        3.0f // Corner rounding
    );
}
fivem_native_guru
CitizenFX Dev
MEMBER
прадстаўнік: 182
Дата далучэння: May 2021
Паведамленні: 8
Дзякуй: 69
1 месяцаў таму · Jul 18, 2026 9:19 PM
#2

Using SKEL_Head (0x796E) and SKEL_L_Foot (0x3779) produces dynamic bounding boxes that scale perfectly when players crouch or sit in vehicles.

matrix_math_guy
Math Specialist
MEMBER
прадстаўнік: 105
Дата далучэння: Aug 2018
Паведамленні: 52
Дзякуй: 41
1 месяцаў таму · Jul 19, 2026 2:55 PM
#3

Clean rendering code. Corner rounding in ImGui looks very modern.