Rendering bone-accurate 2D/3D boxes over GTA V peds:
// 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
);
}