Some recipes mean nothing alone. A shirt pattern is a few numbers that only become a shirt when fitted to a particular body; a hairstyle is instructions for growing hair on a particular head. A part built on another part's product (its mesh, its skeleton, its named regions) is fitted to or grown on it. This page covers that relation, the related run-time attachments (riding a bone, bending with a skeleton), and the packages that do the work. The person as a whole (body, face, eyes) is the clearest case; it is shown here from the point of view of what builds on what.
Words used on this page:
- Skeleton
- A tree of named bones, each a frame relative to its parent bone. Posing it means turning its bones.
- Skinning
- Bending a mesh by a skeleton: each point is tied to up to four bones with weights adding to one, and moves by the weighted mix of their movements.
- Morph target
- A second version of a mesh's points (the face smiling); the renderer moves the points part of the way toward it by a weight, before skinning.
- Shell
- A garment made from the body's own surface, pushed out along its normals and cut at its hems; no simulation.
- Drape
- A garment sewn from flat panels and settled onto the body by a cloth simulation.
How you write it
part person // a design the humanbody package provides; no field changes while the world runs
field sex : Sex = male // an enum: male, female
field build : humanbody.build = average // the 19 survey measures, then muscle, belly, bust and age (below)
field face : humanbody.face = usual // seven numbers, 0 to 1, 0.5 the sex's usual (below)
field look : humanbody.look // skin, lips, brows, iris, how much the crop darkens the scalp
field outfit : humanbody.outfit = shirtAndTrousers // shirtAndTrousers, tunicAndTrousers, dress or shirtAndSkirt
field cloth : (color, color) // the outfit's two cloth colors (below)
field boots : color // the boots' leather
field cape : bool = false // a draped cape over the other garments
field style : hair.style = crop // illustration
field seed : seed // illustration
part body: {
var made = humanbody.body(sex, build, face);
humanbody.faceRig(made, asymmetry: random(seed, 1)); // asymmetry: illustration
made // the ears, teeth, tongue and mouth come with the face; content names none
}, material: humanbody.skin(look)
skinnedTo(self, body)
part leftEye : humanbody.eyes(look.iris), material: materials.eyeGloss, at: body.bone(leftEye)
part rightEye : humanbody.eyes(look.iris), material: materials.eyeGloss, at: body.bone(rightEye)
part shirt : humanbody.top(outfit, color: cloth.0)
fittedTo(self, body)
under(self, trousers)
skinnedTo(self, body)
part trousers: humanbody.bottom(outfit, color: cloth.1)
fittedTo(self, body)
skinnedTo(self, body)
part hair : hair.grow(style), at: body.bone(head) // illustration
grownOn(self, body.head)
part whiskers: hair.grow(beard) // illustration
grownOn(self, body.face)
part lawn
part follower: person(build: (height: 1.864 m, muscle: 0.45, belly: 0.1),
face: (brow: 0.4, nose: 0.7, noseWidth: 0.4, lips: 0.4, jaw: 0.45),
look: (skin: srgb(236, 196, 176), iris: srgb(80, 120, 160), crop: 0.5),
cloth: (srgb(70, 92, 120), srgb(78, 70, 60)), boots: srgb(70, 48, 34)),
at: (-25, land.height(-25, 342), 342)
humanbody.body, faceRig, eyes, top, bottom, skin and the record types are ConeScript spellings of the package's tools (personBody, buildFace, dressPerson, paintSkin, below); hair.grow is an illustration, since no package by that name exists. The relations are calls in the part's body naming the part, and other parts they relate to (fittedTo(self, body), grownOn(self, body.head), under(self, trousers), skinnedTo(self, body)), as other things a part is are written (area(self, ...), seat(...)); riding a bone is the part's at: option (at: body.bone(...)). Two eyes are two parts, each at its own bone. The body is a two-step pipeline written as a block: faceRig stands for the package's buildFace, a plain function, not a method, that adds the face's bones to the body it is given and returns the face's own table, so the body is a var and the block's value is the body.
The relations
| Relation | Meaning | When it acts |
|---|---|---|
fittedTo(self, X) | this part's recipe is made from X's whole surface: the garment is the body's own surface over a region, pushed out | build |
grownOn(self, X.region) | this part's recipe is built on a named region of X's product (a scalp and its hairline landmarks); a hairstyle has no shape of its own | build |
under(self, Y) | an order between two parts fitted to the same body: the inner one is made first and the outer one over it, and the inner one is trimmed where the outer covers it | build |
at: X.bone(name) | this part rides one bone rigidly; its frame is that bone's in the current pose | run time, every frame |
skinnedTo(self, X) | this part bends with all of X's bones, as X's own skin does (a sleeve at the elbow) | run time, every frame |
| (on a surface) | following a surface's morphs (whiskers on the face's skin, moving with a smile); no word yet | run time |
What it means
Derivation between products
The first three relations are derivation at build time: one part's product is an input of another's construction. They fix an order of building and say what to rebuild when a field changes. A person's chain, read top to bottom:
measures, face, sex, look -> body: mesh, skeleton, weights, skin texture body's head and its landmarks -> morph targets, jaw and eye bones (the face) body's surface -> underwear, shirt, then trousers over it, boots, a cape if any shirt and trousers -> which body triangles are drawn skeleton -> where eyes and pieces sit, every frame head's scalp and landmarks -> hair face's skin points -> whiskers
- A new outfit rebuilds only the clothes and which triangles of the body are drawn; a new build rebuilds the body and everything below it.
- A partly loaded world can draw a body before its clothes arrive, never the other way round.
- Derivation runs back: the clothes are made from the body, and then change the body's own product, since triangles wholly under opaque cloth are left out of its drawing. The chain has no loop only because "which triangles are drawn" is a separate product from "the body's surface".
- Because it is derivation, not data, the stored person files are a cache, never content.
Attachment at run time
The last two relations are attachment: place, every frame, from the skeleton's pose. The tree of parts carries ownership (remove the being and its clothes go with it) but not place: no piece of a person takes its position from its frame. Rigid on one bone and bending with many are one mechanism with different weights: a part "at a bone" is a skinned mesh whose every point belongs wholly to that bone, sent the same bone movements as the body. One part may be skinned to several bones (a guard's helmet and spear point in one bronze part), which no single frame could do; two places are two parts, as the two eyes are.
One part over several bones: onBone. A shape tool, onBone(s, bone) (Shape tools: placing a shape), ties a shape wholly to one bone. Used inside join([...]), the pieces tied to different bones make one skinned mesh, so one part in one material. A piece's points are written in the body's rest-pose coordinates: where the point is when the body stands in its rest pose, in the body's own frame, so a piece for the head is drawn where the head is at rest and then goes where the head bone goes. The guards' bronze is one such part:
part bronze: join([
onBone(helmet(height), body.bone(head)), // the helmet: wholly the head's
onBone(belt(height), body.bone(pelvis)), // the belt: wholly the pelvis's
onBone(spearPoint(body.bone(rightHand).rest), body.bone(rightHand)) // a leaf at the spear's tip, where the hand rests
]), material: materials.bronze
skinnedTo(self, body)
Smooth joints: skinChain. onBone ties a shape wholly to one bone, which creases a knee or an elbow. A limb or a trunk that bends smoothly is one shape skinned along a chain of bones: skinChain(shape, bones:, joints:, blend:) (Shape tools: placing a shape), the weights passing from one bone to the next across the zone of each joint. The shoulder is helped by a lean to the clavicle: the points of the upper chest near the shoulder take part of their weight on the collar bone.
Named regions and bones of a product
body.head, body.face and body.bone(leftEye) are not parts. They are things the body's product can answer questions about, as the walkway answers "how far is this point from you". Derivation needs something smaller than a part and larger than a number to point at; a product's type must say which named regions, landmarks and bones it offers. Bone names (head, leftEye, pelvis) belong to the skeleton the body package makes: a creature built from named chains would have other names. body.bone(name).rest is the bone's rest-pose place in the body's coordinates: where the bone sits when the body stands at rest, a place a shape written for that bone can be measured from (the spear's tip is a height above the hand's rest).
The person's fields
- A record field with presets and partial overrides:
build: (muscle: 0.45, belly: 0.1)sets two fields of the package's record and leaves the rest at the preset's. - A range that depends on another field: a sensible stature depends on sex, so it cannot be two plain numbers.
- A field that decides which parts exist: a dress is one garment, shirt and trousers two; the outfit selects parts, which a fixed list of part lines cannot say without a condition.
- A unit "0 to 1, 0.5 the usual": the face's seven numbers.
The person in full
person is a design the humanbody package provides, as cast() provides seven people: a world uses it, as people.tallSlimMan does, and does not declare it. Its fields are these (the code spells its colors with an American color; colors here are srgb numbers 0 to 255).
build: the measures. A field of the build holds the relaxed measure in meters, and the package derives the rest: the jaw's breadth (0.84 of the cheek's) and the heights of the landmarks (the crotch, buttocks, hip bone, navel, nipples, armpit, shoulder point and the neck's base, as shares of the height, each per sex) are worked out from the measures and the sex, and are not fields. The survey measures the upper arm and the forearm flexed; the package keeps 0.92 of the flexed upper arm and 0.96 of the flexed forearm as the relaxed ones. The 19 survey measures, with the average man's:
| Field | Measures | Average man |
|---|---|---|
height | stature | 1.754 m |
biacromial, bideltoid | breadth across the shoulder points; across the shoulder muscles | 0.418 m; 0.512 m |
chestBreadth, chestDepth | at the nipples (for a woman, the bust) | 0.291 m; 0.252 m |
waistBreadth, waistDepth | at the navel | 0.329 m; 0.241 m |
hipBreadth, buttockDepth | the hips; the buttocks | 0.343 m; 0.246 m |
neckGirth | round the neck | 0.395 m |
thighGirth, calfGirth | at the fold of the buttock; the calf | 0.630 m; 0.390 m |
armGirth, forearmGirth, wristGirth | the upper arm; the forearm; the wrist | 0.356 m flexed (0.328 kept); 0.310 m flexed (0.298 kept); 0.176 m |
headLength, headBreadth | the head | 0.200 m; 0.153 m |
faceLength, cheekBreadth | nose bridge to chin; across the cheekbones | 0.120 m; 0.142 m |
Four numbers follow, which belong to build too: bust (0 none to 1 full; 0 for the average man, 0.6 for the average woman), muscle (0 soft, 0.5 ordinary, 1 an athlete; 0.5 and 0.4), belly (0 flat to 1 round; 0.35 and 0.3) and age in years (30 and 28). The average woman's measures are in the package; build: (height: 1.864 m, muscle: 0.45) sets two and leaves the rest at the preset's.
face: seven numbers, each 0 to 1, 0.5 the sex's usual: brow, nose, noseWidth, lips, chin, cheekbones, jaw. The face comes with its ears, its eyeballs, its teeth (six above, six below), its tongue and the dark of its mouth, with a jaw bone and two eye bones and 50 morph targets: humanbody.faceRig adds them all, and content names none of them (the eyes in the example are the exception that shows two places are two parts).
Outfits and the garments of each. outfit is one of four, each a set of garments laid in layers (the table of layers is under the package, below). cloth is two colors, (cloth.0, cloth.1), and each outfit uses them as follows; boots is the boots' leather in all; the briefs (and, for a woman, a band) are always worn under, cream (222, 216, 204):
| Outfit | Garments | Where each cloth color goes |
|---|---|---|
shirtAndTrousers | briefs, shirt, trousers, boots | shirt cloth.0, trousers cloth.1 |
tunicAndTrousers | briefs, shirt, trousers, waistcoat, belt, boots | the shirt is a fixed cream (222, 214, 196) under the waistcoat; waistcoat (silk) cloth.0; trousers cloth.1; the belt a fixed dark leather (40, 28, 22) |
dress | briefs, a bodice with no sleeves, a skirt to below the knee, boots | bodice cloth.0, skirt cloth.1 (the same color for the cast's dress) |
shirtAndSkirt | briefs, blouse, a skirt to the knee, boots | blouse cloth.0, skirt cloth.1 |
The skirt is a lofted tube, not a shell, and the boots end at 0.27 of the height under trousers and at 0.12 of it under a skirt.
The cape (cape: true; the island's main avatar only) is cloth cut to a pattern, settled once when the person is made and kept still afterwards:
field capePattern: text = " garment cape layer 3 fabric density 0.62 stretch 2e-6 shear 2e-5 bend 6 thick 0.006 damping 0.75 air 1.0 sees only pelvis spine chest neck head clavicle_l clavicle_r upper_arm_l upper_arm_r thigh_l thigh_r shin_l shin_r panel cape grid 28 24 axis neck pelvis shift -0.02 face back arc 200 gap 0.024 flare 0.04 minr 0.08 reach 0.70 top arc 0 0 0.26 160 20 32 bottom line -0.72 1.10 0.72 1.10 32 left line -0.24432 0.08893 -0.72 1.10 28 right line 0.24432 0.08893 0.72 1.10 28 loose 0 0 0.04 0 0.12 0.9 0.3 1 1 1 panel collar grid 20 3 axis neck pelvis shift -0.085 face back arc 200 gap 0.012 flare 0 minr 0.05 reach 0.02 top line -0.19 0 0.19 0 20 bottom line -0.21 0.075 0.21 0.075 20 left line -0.19 0 -0.21 0.075 3 right line 0.19 0 0.21 0.075 3 loose 0 0 1 0" let cape = garmentdrape.drapeOnce(pattern: capePattern, steps: 150, wind: (0.3, 0, 0.2), folds: 0.022 m)
The pattern is a text of several lines, as Cone writes one (a string that runs on over lines): the first word of a line is the command, # ends a line, indentation means nothing. drapeOnce(pattern:, steps:, wind:, folds:) sews the panels round the body, ripples them (seven waves, 0.12), lets the cloth settle for steps steps of 1/60 s under a steady wind, then adds folds, a ripple of that depth running down the cloth, and returns the settled garment. It runs at build and the cape is then still. The cape is skinned to the chest, spine and pelvis by height. The pattern names its layer, 3, and the person's outfit sets the layer it is worn at, over the boots: 6 in the table below.
The packages
humanbody: bodies, faces, clothes, poses
People of game quality, as data: ANSUR II survey measures, a look and an outfit, built as a base mesh per sex with blends, skinned to a humanoid skeleton, dressed in shells, given a face of facial-movement units, painted, and posed.
| Tool | What it makes |
|---|---|
buildBlendSet(sex, levels), personBody(set, measures) | the body: mesh, skeleton, skin weights. The skeleton is bonepose.humanoid(height) with the hips placed by the person's own hip breadth: 19 bones, which become 22 when the face adds a jaw and two eye bones. The gait drives the 19 (Package behaviors) |
buildFace(body), morphTargetsOf(face, vertexCount) | the face built on the body's head: 50 morph targets, a jaw and two eye bones, the eyeballs, teeth, tongue and mouth |
paintSkin(body, look, size), paintEye(iris) | the skin texture (with the close crop painted over the scalp to a hairline read from the head's shape) and the iris |
dressPerson(body, person, underwearOnly, threads) | the wardrobe: each garment a skinned mesh in its cloth |
Seat, standPose, sitPose, hailPose | a seat's contract and the body's poses (walking is walkgait's) |
cast() | the fixed cast of seven people |
How clothes are fitted: a garment's region is chosen by which bones' weight picks the body's points; it is pushed out by an ease plus the thickness of what lies beneath, smoothed, and cut at its hems by planes across the body. The layers, inside out:
| Layer | Piece | Ease | Thickness |
|---|---|---|---|
| 0 | briefs | 1.5 mm | 1.5 mm |
| 1 | shirt (cuffs at 0.93 of elbow to wrist) | 4 mm | 3 mm |
| 2 | trousers | 6 mm | 4 mm |
| 3 | waistcoat | 7 mm | 4 mm |
| 4 | belt | 10 mm | 4 mm |
| 5 | boots | 4 mm | 5 mm |
| 6 | cape (a draped pattern, which names its own layer 3; worn here) |
The shirt is tucked into the trousers; a skirt is a lofted tube hanging from the waist, skinned to the pelvis at the top and more and more to each thigh below, so it swings with the stride. Not done: articulated hands, hair (only a cropped scalp painting), normal maps, corrective shapes at the joints.
garmentdrape: clothing for any body
Clothing for any body, defined as data. A garment is either a shell (above) or a sewing pattern: flat panels with edges and seams, placed round the body and draped by a cloth simulation, their rest lengths the flat lengths. The body is a BodyRig with a simple collision shape per bone; a pattern's particles may be tight (skinned), free (simulated) or in between; an outer layer collides with what lies beneath grown by its thickness. Tools: buildShell(spec, rig, beneath), ShellSpec with layer, bones, cuts, ease, thickness, smoothing; Pattern, newPanel, stitch, and a text form read by parsePattern; drape(pattern, rig, inflate, below, threads); dress(rig, shells, patterns, threads) puts them on in layer order. Not handled: tearing between two loose layers; parts of one layer colliding with each other. A cape that is settled once at build and then kept still is drapeOnce(pattern:, steps:, wind:, folds:) (The person in full): drape run for steps steps, with its folds laid on after.
strandflow: strands, including hair
Strands in a flow: a lock of hair, a mane, a tail, a tassel, an anemone's tentacle, kelp; hair is one use of this. Roots are placed by rootsOnMesh(group, mesh, count, density, comb, combAmount, seed), scattered over any mesh's triangles and accepted by a density function (a hairline, a parting: an open function), or on a disc, or along a path; strands are simulated in air or water and drawn as cards or tubes. Style presets: hair, mane, tail, anemone, kelp, tassel. It is deterministic: a head of hair is the same head of hair.
It is not wired to humanbody. strandflow can scatter roots over a mesh, but nothing yet finds a body package's scalp and hairline and hands them to it, so "grown on this head" is not yet expressible. Not done: strand-strand collision or clumping; a hair lighting model (cards read as hair at a distance and as spiky ribbons close up).
Other packages that lay one thing on another
xpbdsoftbody: cloth, ropes, chains and inflated envelopes; a cape can be settled with it once, when the person is made, and kept still afterwards.clothrope: cloth and rope coupled to rigid bodies, with a wind field.skinmesh: a quad mesh and its rig grown from a stick figure of nodes and edges; a way to make a creature's body that names its own bones.sculpt'sshrinkwrap,projectAllanddataTransferlay one surface or its channels onto another (Sculpting).
How it connects
- Construction pipelines: steps of one part, chained or named in a block; this page, between parts.
- Package behaviors: the gait and the face rig that pose what is built here.
- Visitors: a visitor's avatar is a person driven by a being. Under the avatar proposal, the person's own avatar is a person description in this language, owned by the person and carried from world to world, so it is in no world's content; its registration and fetching are outside the content (Avatars; Outside the content).
- Frames: bones as perhaps a frame kind.
- Materials: the skin and cloth materials, made per person.
Open questions
- Regions and landmarks of a product: how content names them, and which product types offer which.
- Whose bone names: the body package's, a creature's chains, or a vocabulary of their own.
- What a bone is to content: a part in the tree; a named frame inside a product; or only a relation (
at:,skinnedTo) realized by weights. - Rigid and skinned: two words, or one ("bound to the skeleton") with the weights the product's business; and a word for following a surface's morphs.
- Layer order of clothes: a relation between two parts (
under(self, ...)), an ordered list on the body, or the clothes maker's own knowledge. - Covering: a helmet over hair, a skirt over legs: how one part's presence changes what another builds or draws.
- Parts that exist because of a field (the outfit).
- Identity against presentation: which fields belong to the person and which a world may change; it decides whether a world can dress a visitor's avatar. A proposal answers this in part: the world gives the avatar, the person's profile says which dimensions and look they bring, and the world states which profile fields it applies and within what ranges (Avatars).
- Seeds for placed individuals: a person's own seed, and streams derived from it by name.
- A recipe's version: the same fields make a different person when the package changes.