human-morph
The body sliders of the character creator (CHARACTER-DESIGN.md), as pure functions over a human pack: which targets a body uses and how much, and the sum that turns them into positions.
MakeHuman's macro targets are sculpted at the CORNERS of a grid: female or
male, baby, child, young or old, three muscle and three weight levels, and
three ancestries. A body between corners is a weighted mix of the corners
around it, and every slider is a position on one axis of that grid. The rules
here are written from MakeHuman's file names and documented behaviour; none of
their (AGPL) code is used. One number is MakeHuman's behaviour rather than its
data: the child corner at age 0.1875 (11 years) is where MakeHuman's own age
slider puts it (apps/human.py, setAge), reproduced so a slider value
means the same body in both.
The sliders, each from 0 to 1:
- gender: female at 0, male at 1
- age: 1 year at 0, 11 at 0.1875, 25 at 0.5, 90 at 1
- muscle and weight: least at 0, average at 0.5, most at 1
- height: shortest at 0, average for the rest of the body at 0.5, tallest at 1
- proportions: uncommon at 0, neutral at 0.5, ideal at 1
- waist: narrowest at 0, as the rest of the body has it at 0.5, widest at 1 (MakeHuman's waist circumference, plus a pinch toward the centre line below 0.5, because that target mostly takes depth off)
african, asian and caucasian are an ancestry MIX, normalised to sum to 1
(all zero is an even mix).
const pack = await loadHumanPack(assetUrl('makehuman/hm08/hm08.json'))
const weights = macroWeights({ ...DEFAULT_HUMAN_BODY, height: 0.9 }, (n) => pack.has(n))
const positions = await morphHuman(pack, weights)
A dense macro costs about 0.03 ms to add on a desktop, so a body is morphed on the spot rather than in a worker.