Gaming & VFX

Gaming, VFX & Metaverse

Avatar generation and engine integration — Unity bone mapping, Unreal MetaHuman blend shapes, NPC crowd generation, and finger rig patterns.

Business Context

The Problem: A height slider doesn’t create a personalized avatar — it just stretches a generic mesh. The underlying skeletal proportions were authored by eye, not measured, which is why your technical artists spend a disproportionate share of their time fixing deformation in the same joints (shoulders, hips, knees, wrists) on every character variant. And when design asks for 50 NPC body variants for an open-world crowd, you’re either spending art days per variant or shipping obvious clones.

The Solution: You need height and weight. DimensionsPot takes those two inputs and returns a complete, 130-point anthropometric profile in under 10ms. You get exact bone lengths to drive the skeletal rig, and precise circumferences to control the blend shapes. Players building their own avatar get a character that actually matches their physical body — their shoulder breadth, their torso-to-leg ratio, their real build.

The Crowd Multiplier: By adjusting target_region and body_build_type, you spawn a crowd with accurate Asian skeletal proportions or European civilian body fat distributions in a scripting loop — no manual modeling required.


ParameterValueReason
anchorsbody_height + body_massPRIMARY_BOTH tier; all skeletal BONE dims at confidence ~85
body_build_typeCIVILIAN / ATHLETIC / OVERWEIGHTMatch character archetype
bundleFULL_BODYAvatar rigs require the complete skeletal and soft-tissue profile
target_regionCharacter’s population originEnsures regionally accurate skeletal proportions
confidence_score_threshold0Include all dimensions; engine ensures internal proportion consistency
include_range_95falseNot needed for rigging; reduces payload
include_iso_codesfalseNot needed for rigging

Dimension categories for avatar rigging:

Rig ComponentKey DimensionsType
Spine / torso heightsitting_height, shoulder_height, cervicale_heightBONE
Shoulder widthbiacromial_breadth, shoulder_breadthBONE
Arm proportionsupper_arm_length, forearm_length, arm_length_totalBONE
Hand detailhand_length, palm_length, all hand_digit_* lengths and widthsBONE
Hip / pelviship_breadth_bicristal, trochanterion_heightBONE
Leg proportionsinseam_length, crotch_height, knee_height, popliteal_heightBONE
Head / facehead_breadth, head_length, bizygomatic_breadth, face_lengthBONE
Soft tissue volumeschest_circumference, waist_circumference_natural, hip_circumference, thigh_circumferenceFLESH
Footfoot_length, foot_breadth, ankle_heightBONE

Sample Request

curl -X POST "https://dimensionspot-bodysize-engine.p.rapidapi.com/v1/predict" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_KEY" \
  -H "X-RapidAPI-Host: dimensionspot-bodysize-engine.p.rapidapi.com" \
  -d '{
    "input_data": {
      "input_unit_system": "metric",
      "subject": {
        "gender": "male",
        "exact_age": 26.0,
        "age_category": "ADULT",
        "input_origin_region": "ASIA_PACIFIC"
      },
      "anchors": {
        "body_height": 1750.0,
        "body_mass": 70.0
      }
    },
    "output_settings": {
      "calculation": {
        "calculation_model": "AUTO",
        "target_region": "ASIA_PACIFIC",
        "body_build_type": "CIVILIAN"
      },
      "requested_dimensions": {
        "bundle": "FULL_BODY",
        "specific_dimensions": null
      },
      "output_format": {
        "unit_system": "metric",
        "confidence_score_threshold": 0,
        "include_range_95": false,
        "include_iso_codes": false
      }
    }
  }'

Unity Humanoid Rig — Bone Mapping

Unity’s Humanoid rig uses bone lengths in metres. Extract and convert from the API response:

// C# — extract dimensions from DimensionsPot response JSON
// All API values are in mm; multiply by 0.001 to convert to metres.
float MM_TO_M = 0.001f;

float upperArmLength = dims["upper_arm_length"]["value"] * MM_TO_M;
float forearmLength  = dims["forearm_length"]["value"]   * MM_TO_M;
float handLength     = dims["hand_length"]["value"]      * MM_TO_M;

// Derived leg segment lengths from standing heights:
//   upper leg (femur) = trochanterion_height − knee_height
//   lower leg (tibia) = knee_height − ankle_height
float upperLegLength = (dims["trochanterion_height"]["value"]
                       - dims["knee_height"]["value"]) * MM_TO_M;
float lowerLegLength = (dims["knee_height"]["value"]
                       - dims["ankle_height"]["value"]) * MM_TO_M;

float spineHeight    = dims["sitting_height"]["value"]    * MM_TO_M;
float shoulderWidth  = dims["biacromial_breadth"]["value"] * MM_TO_M;

BONE dimensions (limb lengths, breadths, skeletal heights) map directly to rig bone lengths. FLESH dimensions (circumferences) drive blend shape weights and clothing simulation mesh targets.


Unreal MetaHuman — Blend Shape Driving

def normalize(value_mm, min_mm, max_mm):
    return max(0.0, min(1.0, (value_mm - min_mm) / (max_mm - min_mm)))

metahuman_params = {
    "chest_width":    normalize(dims["chest_circumference"]["value"], 800, 1400),
    "waist_width":    normalize(dims["waist_circumference_natural"]["value"], 600, 1200),
    "hip_width":      normalize(dims["hip_circumference"]["value"], 700, 1400),
    "shoulder_width": normalize(dims["biacromial_breadth"]["value"], 320, 520),
    "leg_length":     normalize(dims["inseam_length"]["value"], 700, 1050),
    "thigh_girth":    normalize(dims["thigh_circumference"]["value"], 400, 800),
}

NPC / Crowd Generation Pattern

import random

def generate_npc_profile(gender, height_mm, target_region, body_build_type="CIVILIAN"):
    bmi_range = (22, 28) if body_build_type == "ATHLETIC" else (19, 29)
    height_m = height_mm / 1000
    bmi = random.uniform(*bmi_range)
    mass_kg = round(bmi * (height_m ** 2), 1)

    return {
        "input_data": {
            "input_unit_system": "metric",
            "subject": {
                "gender": gender,
                "age_category": "ADULT",
                "input_origin_region": target_region
            },
            "anchors": {
                "body_height": height_mm,
                "body_mass": mass_kg
            }
        },
        "output_settings": {
            "calculation": {
                "calculation_model": "AUTO",
                "target_region": target_region,
                "body_build_type": body_build_type
            },
            "requested_dimensions": {"bundle": "FULL_BODY"},
            "output_format": {
                "unit_system": "metric",
                "confidence_score_threshold": 0,
                "include_range_95": False,
                "include_iso_codes": False
            }
        }
    }

Response Handling Tips

  • All API values are in mm — multiply by 0.001 before applying to Unity/Unreal transforms.
  • BONE dimensions map to skeletal rig bone lengths. FLESH dimensions drive blend shape weights. The type field in each dimension response indicates which category applies.
  • For NPC crowd generation, vary body_mass around a population mean while keeping body_height fixed — this produces realistic body composition variation within a height cohort.
  • body_build_type: "ATHLETIC" removes the NHANES civilian fat-distribution shift, producing leaner circumference proportions suitable for soldier, athlete, or action character archetypes.
  • For runtime avatar generation, cache the full API response client-side — re-calling the API on every scene load adds unnecessary latency and wastes API quota.
  • Normalise circumference values to [0, 1] using anatomically plausible min/max bounds before feeding into blend shape parameters — not the API’s biological limit values.
  • target_region controls skeletal proportion calibration, not just scale. East Asian profiles (ASIA_PACIFIC) have proportionally different torso-to-leg ratios and shoulder widths compared to EUROPE.