3D pose guides for generated unit sprites

Use a posed 3D model to establish geometry before asking the image generator for finished unit art. The guide supplies camera, facing, body placement, foreshortening and equipment contacts. An existing sprite supplies character design and style. This is the standard method for new directional unit generations.

The guide can be a mannequin, a skeleton represented by limb primitives, an existing unit model, or a posed triangle mesh. It need not be attractive final art. The generator replaces its coarse surfaces with the requested character appearance. An agent may verify projection math and reject defects; only the user may visually approve a sprite. See the approval gate.

Reusable tool

# One heading, using the mannequin from the NE prone MG experiment.
node scripts/art/render-unit-pose-guide.mjs \
  --preset mg-prone --heading ne --out target/unit-pose-guides/mg-prone

# The same geometry, camera and pixels-per-unit in all sixteen headings.
node scripts/art/render-unit-pose-guide.mjs \
  --preset mg-prone --heading all --out target/unit-pose-guides/mg-prone-all

# Verify existing outputs exactly without rewriting them.
node scripts/art/render-unit-pose-guide.mjs \
  --preset mg-prone --heading all --out target/unit-pose-guides/mg-prone-all --check

Available presets include rifleman-standing, rifleman-prone, machine-gunner-standing, machine-gunner-prone, panzerfaust-standing and panzerfaust-prone. mg-prone retains the original NE experiment model.

The static review batch can be rebuilt with node scripts/art/build-infantry-static-review-guides.mjs and packed with node scripts/art/pack-infantry-static-review.mjs; both support --check. These authoring assets have no live renderer binding.

The default camera is derived from CAMERA.experimentalMapTilt: currently 55 degrees above horizontal ground, or 35 degrees from vertical/top-down. For an intentional camera study, use the unambiguous --elevation-above-ground 55 flag. There is no ambiguous --tilt 55 input. Azimuth and roll remain fixed at zero.

The tool writes:

These outputs are geometric references, not final sprite artwork or visual approval. No image-generation API is called by the tool. Continue with the built-in image tool and preserve the exact augmented prompt and image inputs used for that generation.

Pose an editable model

Copy the exported model.json into the candidate’s versioned references/ directory, edit its limb/end-point or part positions, then render it:

node scripts/art/render-unit-pose-guide.mjs \
  --model client/assets/rigs/<candidate>/references/posed-model.json \
  --heading ne --out target/unit-pose-guides/posed-candidate

The schema is schemaVersion: 1, with optional name, units, anchor and pixelsPerUnit, plus a nonempty primitives array. For example:

{
  "schemaVersion": 1,
  "name": "posed-example",
  "units": "metres",
  "anchor": [0, 0, 0],
  "pixelsPerUnit": 260,
  "primitives": [
    {"shape": "ellipsoid", "center": [0, 0, 0.25], "radii": [0.4, 0.2, 0.12], "color": [190, 35, 175]},
    {"shape": "tube", "start": [-0.3, 0.1, 0.2], "end": [-0.8, 0.15, 0.1], "radius": 0.08, "color": [190, 35, 175]},
    {"shape": "box", "center": [0.6, 0.1, 0.3], "size": [0.5, 0.06, 0.06], "color": [60, 60, 60]}
  ]
}

Coordinates are +x unit-forward, +y anatomical right, +z up. They are model-local positions before heading rotation. anchor specifies the pivot that projects to the fixed image origin: feet for a standing pose, abdomen for a prone pose. Pose the same anatomy/loadout consistently across setup, locomotion, aim and recoil states.

Supported primitives are boxes (center, size), ellipsoids (center, radii), tubes (start, end, radius), and meshes (vertices, triangle-index faces). Each has an integer RGB color array. Boxes, ellipsoids and meshes accept yaw/pitch in radians; pitch raises the forward end, then yaw rotates around z. Mesh vertices are local to its optional center. Pose tubes by editing their endpoints. Meshes can carry posed geometry exported from an existing unit model.

Existing in-game coarse shadow geometry is also available:

node scripts/art/render-unit-pose-guide.mjs \
  --proxy-kind panzerfaust --heading ne \
  --out target/unit-pose-guides/panzerfaust-proxy

Use --proxy-candidate <id> for a specific existing variant. These are the actual box volumes from projected_unit_shadow_model_candidates.js, in world pixels; they supply coarse geometry, not detailed human anatomy. Their default scale is 8 pixels per world pixel. Use an appropriately posed mannequin/mesh when limb placement matters.

--pixels-per-unit changes one uniform family scale. The tool never fits each heading to its own bounding box. It fails if geometry enters the canvas margin; reduce the shared scale or increase --size (maximum 2048). Retain the same scale/camera while rotating a unit through headings. Do not mirror a bitmap to manufacture another view.

Shared-model size and shadows

Use one unit model as the source of pose guides, physical dimensions, attachment pivots and simplified shadow geometry. Keep its dimensions and world-units conversion fixed across headings. Preserve assembled context when generating separate movable parts.

Derive shadow boxes from that model rather than choosing an unrelated generic proxy. Collapse wheels, hatches and other small details into a few conservative boxes; do not send the full generation mesh to the shadow renderer. Preserve independently rotating groups and their shared pivots, and make their shadow headings follow the rendered sprite headings, including direction snapping. Match contact-shadow footprints to the same model.

Scale calibration must use a broad body region or long physical span: the painted body shell, hull/deck perimeter, head-to-foot body height, or frontmost-to-rearmost axle spacing when both endpoints are clear. Never set scale from boot size, wheel-hub diameter, helmet size, or another small isolated detail: a few annotation pixels can create a large error. Foot/sole contact points may establish the ground anchor; that is not a size measurement. Compare the same large region or span against the model at the matching pose and heading. A whole-body extent can be useful when its included parts match the model; do not make different headings share one arbitrary screen bounding box.

Image generation can change apparent proportions even with a correct guide. Calibrate each generated view against the same named physical body feature, such as the hull’s top deck or the turret body, and its expected projection from the model. Whole-image bounding boxes and longest silhouette axes are not physical size references: barrels, tracks, exhausts and visible side faces can change them between views. A planar feature’s projected area can be useful when it is invariant across the reviewed headings; do not assume every feature or animated pose has invariant visible area.

Record the source-image hash, matching landmarks or material region, model dimensions, registration method and annotation uncertainty. Use uniform scaling and translation while preserving ground anchors and attachment pivots. Do not stretch artwork to conceal differing proportions, or force every heading into equal screen bounds. Foreshortening and camera depth can legitimately change those bounds; report remaining generated shape differences.

Before directional review, compare all headings at one world anchor with identical camera, zoom and viewport. Include a turn-in-place review and independently aimed movable parts when applicable; verify size, pivots and shadows together. Add reproducible registration and shadow-geometry checks to the unit’s tooling when implementing its pipeline. A moving demo can supplement this check, but cannot isolate size variation from camera depth. The tank’s size registration and scripts/art/build-tank-shadow-model.mjs are worked examples, not universal constants or a shared tool that already enforces this policy for every unit.

Camera and heading contract

The camera stays fixed while the model rotates. The sixteen-heading order is the existing infantry convention: south, SSW, SW, WSW, west, WNW, NW, NNW, north, NNE, NE, ENE, east, ESE, SE, SSE; first facing is pi/2 with pi/8 steps, positive world Y down.

For ground-plane world coordinates (x,y,z) at camera elevation e, orthographic screen offsets are (x, y*sin(e) - z*cos(e)) times the shared pixels-per-unit value. A NE ground-forward axis at 55-degree elevation therefore appears approximately 39.3 degrees up-right on the image. Its 45-degree compass bearing is a separate quantity from camera elevation. North/south and intermediate headings reveal foreshortening mistakes that a side view can hide.

Generation and user review

  1. Create or reuse a unit model/mannequin and pose it for one state and heading. Check the anatomy’s handedness and physical contacts: feet, elbows, bipod, trench lip.
  2. Render the guide with the intended camera. Preserve the editable model, guide PNG, metadata and generator version with the candidate’s references.
  3. Feed the guide as reference 1: authoritative pose/camera. Feed user-approved character art as reference 2: character/material/style only. Explicitly state that an old reference’s baked camera must not override the guide.
  4. Generate one sprite candidate, then apply the normal source-resolution material split and final-scale packing. Use uniform scale changes for size corrections; do not stretch or rotate a sprite to conceal camera/pose mistakes.
  5. Show an actual in-game render at the target camera and scale, with a reference unit and projected ground-direction guide when useful. User visual approval is required before approving the sprite, expanding the directional generation batch, or live use.
  6. After that approval, render further geometry guides with the same camera/model scale. Arrange related headings into a matching guide sheet and generate the authorized directional variants together, normally eight views per request, following the directional sheet guidance. Preserve the successful prototype’s approved art and assembled-context references across requests. Each new result still needs review; shared generation context can reduce drift but the generator can still ignore a guide or change anatomy/equipment.

Keep raw outputs, actual prompts, reference-image order, model/camera data, technical packing checks, in-game evidence and user review decisions. A correct geometric projection or a successful tool/PR check does not establish that a sprite looks right.