@algorisys/tinyfly 0.99.0 → 0.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/bin/tinyfly.mjs +7 -3
- package/docs/acting.md +10 -6
- package/docs/character-appearance.md +71 -7
- package/docs/editor-guide.md +38 -3
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +34 -9
- package/docs/maps.md +2 -2
- package/docs/props.md +61 -1
- package/docs/scene-3d.md +23 -4
- package/docs/teaching.md +1 -1
- package/docs/video-rendering.md +154 -0
- package/lib/addons/adapters.js +387 -333
- package/lib/addons/characters.js +4795 -3752
- package/lib/addons/load-scene-oWNsYYC1.js +372 -0
- package/lib/addons/scene-3d-webgl.js +1 -1
- package/lib/addons/scene-3d.js +323 -277
- package/lib/addons/shading-0lPgnXmD.js +96 -0
- package/lib/browser/tinyfly-scene-3d.iife.js +2 -2
- package/lib/browser/tinyfly.iife.js +14 -14
- package/lib/browser/tinyfly.js +7294 -5893
- package/lib/browser/tinyfly.umd.js +14 -14
- package/lib/engine/tinyfly-engine.js +1389 -1031
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/headless/headless.js +39 -0
- package/lib/types/adapters/canvas/impossible.d.ts +15 -0
- package/lib/types/adapters/canvas/index.d.ts +3 -0
- package/lib/types/adapters/canvas/nested-zoom.d.ts +40 -0
- package/lib/types/adapters/canvas/zoom-blur.d.ts +49 -0
- package/lib/types/characters/acting/character-script.d.ts +14 -2
- package/lib/types/characters/acting/script.d.ts +9 -0
- package/lib/types/characters/capabilities.d.ts +2 -0
- package/lib/types/characters/character.d.ts +28 -1
- package/lib/types/characters/hair-follow.d.ts +12 -6
- package/lib/types/characters/hands/held-items.d.ts +6 -2
- package/lib/types/characters/head/face.d.ts +23 -1
- package/lib/types/characters/index.d.ts +3 -2
- package/lib/types/characters/interactions.d.ts +60 -0
- package/lib/types/characters/props/families/animals.d.ts +6 -0
- package/lib/types/characters/props/families/birds.d.ts +16 -0
- package/lib/types/characters/props/families/furniture.d.ts +102 -0
- package/lib/types/characters/props/index.d.ts +1 -0
- package/lib/types/characters/props/presets.d.ts +15 -2
- package/lib/types/characters/props/ride-3d.d.ts +4 -1
- package/lib/types/characters/scenery.d.ts +126 -0
- package/lib/types/characters/species/human-motion.d.ts +17 -0
- package/lib/types/characters/species/human.d.ts +6 -0
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +16 -5
- package/lib/types/engine/authoring/beat-loop.d.ts +46 -0
- package/lib/types/engine/authoring/curve.d.ts +26 -0
- package/lib/types/engine/authoring/index.d.ts +3 -0
- package/lib/types/engine/authoring/periodic.d.ts +89 -0
- package/lib/types/engine/path/goo.d.ts +103 -0
- package/lib/types/engine/path/impossible.d.ts +92 -0
- package/lib/types/engine/path/index.d.ts +6 -0
- package/lib/types/engine/path/similarity.d.ts +48 -0
- package/lib/types/headless/index.d.ts +1 -0
- package/lib/types/headless/loop-audio.d.ts +21 -0
- package/lib/types/headless/node-audio.d.ts +20 -0
- package/lib/types/headless/video-scene.d.ts +9 -0
- package/lib/types/scene-3d/camera.d.ts +11 -2
- package/lib/types/scene-3d/geometry/mesh.d.ts +2 -0
- package/lib/types/scene-3d/geometry/primitives.d.ts +7 -0
- package/lib/types/scene-3d/impossible-3d.d.ts +29 -0
- package/lib/types/scene-3d/index.d.ts +4 -3
- package/lib/types/scene-3d/resolve-scene.d.ts +13 -1
- package/lib/types/scene-3d/scene-3d-adapter.d.ts +2 -0
- package/lib/types/scene-3d/scene-types.d.ts +29 -4
- package/lib/types/scene-3d/shading.d.ts +2 -0
- package/llms-full.txt +423 -47
- package/llms.txt +29 -29
- package/package.json +2 -2
- package/skills/tinyfly/SKILL.md +20 -6
- package/lib/addons/load-scene-CQvcFWGJ.js +0 -331
- package/lib/addons/shading-o5T_v9DT.js +0 -89
package/llms-full.txt
CHANGED
|
@@ -204,7 +204,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
204
204
|
```html
|
|
205
205
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
206
206
|
|
|
207
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
207
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly.iife.js"></script>
|
|
208
208
|
<script>
|
|
209
209
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
210
210
|
</script>
|
|
@@ -412,7 +412,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
412
412
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
413
413
|
|
|
414
414
|
```html
|
|
415
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
415
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly.iife.js"></script>
|
|
416
416
|
<script>
|
|
417
417
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
418
418
|
</script>
|
|
@@ -2278,7 +2278,7 @@ For simple website embedding without a build system.
|
|
|
2278
2278
|
</html>
|
|
2279
2279
|
```
|
|
2280
2280
|
|
|
2281
|
-
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
2281
|
+
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly-player.iife.js`.
|
|
2282
2282
|
|
|
2283
2283
|
---
|
|
2284
2284
|
|
|
@@ -5490,6 +5490,7 @@ Shapes, text, images, video, lines, arrows and paths are added from the
|
|
|
5490
5490
|
| **🗺 Map** | An animated map: places, a route between them, and a camera (see [Maps](#maps)) |
|
|
5491
5491
|
| **🧊 3D Scene** | A real 3D scene seen through its camera: meshes, lights, characters and props (see [3D Scenes](#3d-scenes)) |
|
|
5492
5492
|
| **⌨ Code** | A code panel whose lines a Character's beats aim at and change (see [Code](#code)) |
|
|
5493
|
+
| **📊 Chart** | A bar, line, pie or donut chart from data, whose bars and slices beats aim at, change and ride (see [Charts](#charts-1)) |
|
|
5493
5494
|
|
|
5494
5495
|
Polygon and star are **parametric** paths: change the sides/points/inner ratio in
|
|
5495
5496
|
the Property Panel and the shape regenerates, and they rescale cleanly when you
|
|
@@ -5629,11 +5630,13 @@ Dances and flips are written as they are, and turn acting off.
|
|
|
5629
5630
|
character's tracks and kept on the element (`beats` in the JSON). Write them
|
|
5630
5631
|
as JSON (`[{ "do": "walk", "to": 320, "mood": "happy" }, { "do": "say",
|
|
5631
5632
|
"say": "Hello!" }, { "do": "take" }]`) and click **🎬 Run beats**; the
|
|
5632
|
-
timeline grows to fit. A beat can aim at a **⌨ Code** element's lines
|
|
5633
|
+
timeline grows to fit. A beat can aim at a **⌨ Code** element's lines or a
|
|
5634
|
+
**📊 Chart** element's bars, points and slices
|
|
5633
5635
|
(`"target": { "surface": "Code 1", "anchor": "line:2" }`, also for `to`,
|
|
5634
5636
|
`toward` and `onto`) and change them (`"then": { "surface": "Code 1",
|
|
5635
5637
|
"edit": "highlight", "anchor": "line:2", "at": "contact" }`): the edits
|
|
5636
|
-
become tracks on that element
|
|
5638
|
+
become tracks on that element, and a figure standing on a bar or a line
|
|
5639
|
+
rides it as it moves. Problems are named by beat (an unknown
|
|
5637
5640
|
action, mood or place) before anything is written. The AI prompt bar writes
|
|
5638
5641
|
beats this way too.
|
|
5639
5642
|
|
|
@@ -5718,6 +5721,28 @@ Its tracks are on the element, named `object.property` (`box.rotateY`,
|
|
|
5718
5721
|
DOM and Canvas previews and in GIF / WebP / MP4 export. See [3D
|
|
5719
5722
|
Scenes](scene-3d.md) for the same from code.
|
|
5720
5723
|
|
|
5724
|
+
### Charts
|
|
5725
|
+
|
|
5726
|
+
A **📊 Chart** element is a `chart()` from code: a bar, line, pie or donut
|
|
5727
|
+
chart drawn by code into its box. In the property panel: the **Kind**,
|
|
5728
|
+
**Title**, **Theme** (light or dark), **Max** (the top of the scale; blank
|
|
5729
|
+
for a round number above the data), **Value labels** (a prefix, a suffix,
|
|
5730
|
+
decimal places, and whether to show them), **Axis titles**, the **Data** as
|
|
5731
|
+
JSON (`[{ "id": "q1", "label": "Q1", "value": 45 }, …]`; `"hidden": true`
|
|
5732
|
+
starts a bar, point or slice out of sight) and, for several series, the
|
|
5733
|
+
**Series** (`[{ "id": "plan", "label": "Plan" }, …]`, each datum then with
|
|
5734
|
+
`"values": { "plan": 40, … }`). Bad data is named under the fields instead of
|
|
5735
|
+
breaking the stage.
|
|
5736
|
+
|
|
5737
|
+
Its bars, points and slices are places. A Character's **Beats** aim at them
|
|
5738
|
+
(`{ "surface": "Chart 1", "anchor": "bar:q2" }`), change them (`set` to a
|
|
5739
|
+
value, `show` a hidden one, `highlight`, `pull` a slice out) and ride them:
|
|
5740
|
+
a figure that leaps `onto` a bar is carried up as the bar grows. The edits are
|
|
5741
|
+
tracks on the Chart element named `bar.q2.value`, `slice.a.pull` and so on,
|
|
5742
|
+
which you can also key by hand. Charts show in the DOM and Canvas previews and
|
|
5743
|
+
in GIF / WebP / MP4 export. See [Charts](acting.md#charts) for the same from
|
|
5744
|
+
code.
|
|
5745
|
+
|
|
5721
5746
|
### Selecting Elements
|
|
5722
5747
|
|
|
5723
5748
|
- **Click** an element to select it
|
|
@@ -6511,7 +6536,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
6511
6536
|
**Steps to embed:**
|
|
6512
6537
|
1. Build the player: `npm run build:player`
|
|
6513
6538
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
6514
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
6539
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly-player.iife.js`
|
|
6515
6540
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
6516
6541
|
3. Copy the generated code into your HTML
|
|
6517
6542
|
4. Adjust the script `src` path if needed
|
|
@@ -6550,6 +6575,16 @@ The preview panel supports three rendering modes, switchable via the renderer se
|
|
|
6550
6575
|
|
|
6551
6576
|
All three renderers play the same animation — switch between them to verify cross-renderer compatibility.
|
|
6552
6577
|
|
|
6578
|
+
Every renderer is editable on stage. The DOM preview's elements take the
|
|
6579
|
+
pointer themselves; the Canvas and SVG previews draw into one surface, so a
|
|
6580
|
+
transparent hit layer over the drawing carries the same boxes, handlers and
|
|
6581
|
+
selection chrome (resize and rotation handles, path points), placed by the
|
|
6582
|
+
animation and the camera exactly as the drawing is. Clicking selects (the
|
|
6583
|
+
topmost element first), dragging moves, handles resize and rotate, and the
|
|
6584
|
+
grid, snapping, rulers, guides, the pen tool and camera panning work the
|
|
6585
|
+
same whichever preview is on. Characters, charts, props and 3D scenes, which
|
|
6586
|
+
only the Canvas preview draws fully, can be arranged there directly.
|
|
6587
|
+
|
|
6553
6588
|
### Onion skinning
|
|
6554
6589
|
|
|
6555
6590
|
In the **Canvas** renderer, click **🧅 Onion** to show faint **ghost frames**
|
|
@@ -7492,14 +7527,22 @@ one probably meant, and `propScript` throws on them.
|
|
|
7492
7527
|
| `car()`, `truck()`, `bus()`, `tractor()`, `cart()`, `trainCar()`, `bike()`, `motorbike()` | `drive` (`to`), `brake` (`to`, a skid with locked wheels), `bump`, `honk`, `door` (`open`), `lights` (`on`) — doors and lights where it has them |
|
|
7493
7528
|
| `tree()` | `sway` (`wind`, `for`), `shake`, `shedLeaves` |
|
|
7494
7529
|
| `house()` | `door` (`open`), `lights` (`on`), `smoke` (`for`, runs in the background), `shake` |
|
|
7530
|
+
| `chair()` | `tip` (`for`: back on its rear legs, then settles), `fall` |
|
|
7531
|
+
| `desk()` | `drawer` (`open`) |
|
|
7532
|
+
| `bed()` | `bounce` (`for`: the mattress gives and springs back) |
|
|
7533
|
+
| `door()` | `open` (`open`, `for`), `slam`, `knock` (`for`) |
|
|
7534
|
+
| `wheelchair()` | `roll` (`to`; the wheels turn the distance), `brake` (`to`, wheels locked), `wheelie` (`for`) |
|
|
7495
7535
|
| `helicopter()` | `takeOff` (`height`), `fly` (`to`, `height`), `hover`, `land` |
|
|
7496
7536
|
| `airplane()` | `takeOff` (`to`, `height`), `fly` (`to`, `height`), `loop`, `land` (`to`) |
|
|
7497
7537
|
| `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
7498
7538
|
| `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
7499
7539
|
| `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
7500
7540
|
| `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
7541
|
+
| `goat()` | `walk`, `trot`, `gallop` (`to`), `bleat`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
7542
|
+
| `rabbit()`, `squirrel()` | `walk`, `gallop` (`to`: a hop, a scamper), `squeak` / `chatter`, `graze` (nibble), `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
7501
7543
|
| `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `glide` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
|
|
7502
7544
|
| `chicken()` | `walk` (`to`), `peck`, `flap`, `flutter`, `cluck` (it cannot fly) |
|
|
7545
|
+
| `pigeon()`, `duck()`, `owl()`, `parrot()` | As the songbird: `hop`, `walk`, `peck`, `flap`, `fly`, `glide`, `land`, and `coo` / `quack` / `hoot` / `squawk` |
|
|
7503
7546
|
|
|
7504
7547
|
**Line art.** `propTarget({ …, style: 'stick' })` (or `drawSolvedProp(…, { style: 'stick' })`)
|
|
7505
7548
|
draws a prop as line art to go with stick figures: tubes (legs, necks, tails,
|
|
@@ -7526,7 +7569,8 @@ neck stretches down to reach), and it walks with its head bobbing or hops.
|
|
|
7526
7569
|
air) and flies to `height` metres; `glide` holds the wings out still and sinks
|
|
7527
7570
|
gently toward `height` on the way to `to` (from the ground it flies the first
|
|
7528
7571
|
stretch); `land` comes down to the ground or to a
|
|
7529
|
-
perch (`height`)
|
|
7572
|
+
perch (`height`), and landing above the ground its toes curl round the perch
|
|
7573
|
+
(`grip`, cleared as it takes off). Perch it with anchors:
|
|
7530
7574
|
|
|
7531
7575
|
```js
|
|
7532
7576
|
const branch = propAt(treeTarget, { time: 0 }, 'tree').anchor('branch')
|
|
@@ -7550,6 +7594,26 @@ Make your own from the family generators: `vehicle(spec)` takes:
|
|
|
7550
7594
|
|
|
7551
7595
|
`tree(spec)` and `house(spec)` take sizes and colours.
|
|
7552
7596
|
|
|
7597
|
+
**Furniture.** `chair()`, `desk()`, `bed()` and `door()` stand on the ground
|
|
7598
|
+
facing the viewer, and their places are anchors a figure uses them at: a
|
|
7599
|
+
chair's `seat` (ride it with `propRide({ anchor: 'seat' })`, a `seated` pose
|
|
7600
|
+
and `offset: { y: seatHeight(height) }`), `back` and `front`; a desk's `top`,
|
|
7601
|
+
`edge`, `drawer` and the `chair` spot in front; a bed's `mattress`, `pillow`,
|
|
7602
|
+
`foot` and `side`; a door's `handle`, `doorway`, `front` and `beyond` (a figure
|
|
7603
|
+
goes through from `front` to `beyond`, and the door is drawn over it until it
|
|
7604
|
+
opens). Each takes sizes and colours (`chair({ seatHeight: 0.5 })`, `door({
|
|
7605
|
+
hinge: 'right' })`). As surfaces (`propSurface`), their controls are edits a
|
|
7606
|
+
beat makes: `set` or `switch` `control:open`, `control:drawer`, `control:tip`.
|
|
7607
|
+
|
|
7608
|
+
A `wheelchair()` is furniture that moves: a seat and back on a frame, two big
|
|
7609
|
+
rimmed wheels, castors and footrests. It `roll`s to a place with its wheels
|
|
7610
|
+
turning exactly the distance (in 3D, its `roll` move does the same in
|
|
7611
|
+
metres), `brake`s with them locked, and tips back for a `wheelie`. Any
|
|
7612
|
+
character rides its `seat` in the `wheeling` pose (`RIDING_POSES.wheeling`:
|
|
7613
|
+
sitting up, hands down at the rims), and a pusher stands at `handles` in the
|
|
7614
|
+
`push` pose. It is an accessory, not an age or a build: who uses it is the
|
|
7615
|
+
story's choice, like a `cane` in a hand.
|
|
7616
|
+
|
|
7553
7617
|
## Figures with props
|
|
7554
7618
|
|
|
7555
7619
|
- **Riding.** `propRide({ prop, propId, propTracks, anchor: 'seat', figure, figureId, start, end, offset })`
|
|
@@ -7568,6 +7632,37 @@ Make your own from the family generators: `vehicle(spec)` takes:
|
|
|
7568
7632
|
See the gallery cards **Road Trip**, **Windy Day**, **Helicopter**,
|
|
7569
7633
|
**Traffic**, **Horse & Cart**, **Farmyard**, **Birds** and **3D Scene: Village**.
|
|
7570
7634
|
|
|
7635
|
+
## Scenery
|
|
7636
|
+
|
|
7637
|
+
`scenery(options)` is the world behind the figures: a canvas target that draws
|
|
7638
|
+
a sky (the sun and moon on their arcs, stars at night, clouds drifting on the
|
|
7639
|
+
wind, rain that slants with it, snow that drifts, hills or a city on the
|
|
7640
|
+
horizon, the ground) or a room (a wall, a floor and a window on that sky). Its
|
|
7641
|
+
values are tracks, so a day passes and weather comes and goes as keyframes,
|
|
7642
|
+
and every frame is drawn from its time alone:
|
|
7643
|
+
|
|
7644
|
+
```js
|
|
7645
|
+
const sky = scenery({ x: 0, y: 0, width: 720, height: 400, hour: 9, clouds: 0.4, horizon: 'hills' })
|
|
7646
|
+
sky.set('hour', { at: 0, value: 20, duration: 12000 }) // dawn to night
|
|
7647
|
+
sky.set('wind', { at: 3000, value: 0.8, duration: 1000 })
|
|
7648
|
+
sky.set('rain', { at: 5000, value: 0.8, duration: 1500 })
|
|
7649
|
+
const tracks = sky.tracks('sky') // hour, wind, rain keys on 'sky'
|
|
7650
|
+
sky.anchor('sun', 4000) // where the sun is then
|
|
7651
|
+
```
|
|
7652
|
+
|
|
7653
|
+
`hour` runs 0–24, `clouds`, `rain` and `snow` 0–1, `wind` −1 (from the right)
|
|
7654
|
+
to 1 (from the left). The same wind streams a character's hair:
|
|
7655
|
+
`hairFollowTracks(target, tracks, who, { wind })`. `kind: 'room'` draws a wall
|
|
7656
|
+
and a floor with a `window` on the sky; `horizon` is `hills`, `city` (lit
|
|
7657
|
+
windows at night) or `flat`; `colors` recolour any of it.
|
|
7658
|
+
|
|
7659
|
+
`scenePreset(name, { width, height })` lays out a scene as plain data (the
|
|
7660
|
+
scenery and where the props stand) and `buildScene` builds it into targets:
|
|
7661
|
+
`park` (a late-morning sky over hills, two trees and a bench), `street` (the end
|
|
7662
|
+
of the afternoon against the city: houses, a car, a tree), `office` (a room
|
|
7663
|
+
with a desk, a chair and a door) and `home` (a room at night with a bed, a
|
|
7664
|
+
chair and a door). The Park Day card plays a day over the park.
|
|
7665
|
+
|
|
7571
7666
|
## In 3D scenes
|
|
7572
7667
|
|
|
7573
7668
|
Props stand in `@algorisys/tinyfly/scene-3d` scenes too:
|
|
@@ -7624,10 +7719,16 @@ in `@algorisys/tinyfly/characters`.
|
|
|
7624
7719
|
|
|
7625
7720
|
## Props
|
|
7626
7721
|
|
|
7627
|
-
For objects in a story (vehicles, trees, houses,
|
|
7628
|
-
use the presets (`car()`, `tree()`, `
|
|
7722
|
+
For objects in a story (vehicles, trees, houses, furniture, aircraft,
|
|
7723
|
+
animals, birds), use the presets (`car()`, `tree()`, `chair()`, `door()`,
|
|
7724
|
+
`wheelchair()`, `helicopter()`, `dog()`, `goat()`, `owl()`…) with
|
|
7629
7725
|
`propTarget` and `propScript`; the catalog lists each preset's actions,
|
|
7630
|
-
controls and anchors, and `checkPropBeats` checks prop beats.
|
|
7726
|
+
controls and anchors, and `checkPropBeats` checks prop beats. Furniture has
|
|
7727
|
+
the places a figure uses it at as anchors (`seat`, `top`, `mattress`,
|
|
7728
|
+
`handle`, `doorway`): aim beats at them rather than guessing a spot. For a
|
|
7729
|
+
sky or a room behind everything use `scenery()` (or `scenePreset('park')`),
|
|
7730
|
+
whose `hour`, `clouds`, `wind`, `rain` and `snow` are tracks, not a drawing
|
|
7731
|
+
of your own. `style: 'stick'`
|
|
7631
7732
|
draws any prop as line art to go with stick figures. A bird's `lift` is in
|
|
7632
7733
|
metres: to perch it on a branch or a roof, work the height out from that
|
|
7633
7734
|
prop's anchor (`propAt(tree, frame, 'tree').anchor('branch')`). In a 3D
|
|
@@ -7643,18 +7744,28 @@ seated with `propRide3D` and spliced into its script with `spliceTracks`. See `d
|
|
|
7643
7744
|
|
|
7644
7745
|
A v2 character's appearance is plain options to `character()`, never drawing
|
|
7645
7746
|
code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
|
|
7646
|
-
`{ style, color, length, … }`), `facialHair`, `glasses`, `hat`, `ears: true
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7747
|
+
`{ style, color, length, … }`), `facialHair`, `glasses`, `hat`, `ears: true`,
|
|
7748
|
+
`face: { teeth, tongue }` (shown when the mouth opens), `feet` (`round`,
|
|
7749
|
+
`flat`, `pointed`, `big`) and `outfit: { shirt, trousers, over: 'hoodie' |
|
|
7750
|
+
'cardigan' | 'overalls' | 'sari' | 'apron' | 'labCoat', shoes: 'boots' }`.
|
|
7751
|
+
`castMember('grandpa', 300)` gives a whole ready-made character to start
|
|
7752
|
+
from. Age is hair, glasses and clothes, never a stoop; a `cane` in a hand or
|
|
7753
|
+
a `wheelchair()` to ride (`RIDING_POSES.wheeling`) is an accessory any
|
|
7754
|
+
character can have. Expressions come from `HUMAN_EXPRESSIONS`
|
|
7755
|
+
and are pose fields, as are the face marks `blush`, `tears` and `sweat` (0–1)
|
|
7756
|
+
and the close-up fields `pupil`, `lid` and `bulge`, so any face goes with any
|
|
7757
|
+
action or view; `drawCharacterHead(ctx, who, pose, { x, y, radius })` draws
|
|
7758
|
+
just the head big, and `face: { nose, inPupil }` adds a nose and a drawing in
|
|
7759
|
+
the pupils. Hair and hats turn with the head:
|
|
7651
7760
|
don't draw a different hairstyle per view. Hanging hair swings on its own:
|
|
7652
7761
|
after the character's tracks add `hairFollowTracks(target, tracks, who)` (or,
|
|
7653
7762
|
posing per frame, `hairFollow` once and `hairMotionAt(keys, t)` each frame)
|
|
7654
7763
|
rather than keying `hair.swing` by hand. Put things in hands with `holding`
|
|
7655
7764
|
(`{ right: 'mug' }`, `{ both: 'parcel' }`; the pose field `held.both` lets go),
|
|
7656
7765
|
and for two characters touching use `meetHands('handshake', a, b)` with the
|
|
7657
|
-
two standing `meetingSpacing(…)` apart,
|
|
7766
|
+
two standing `meetingSpacing(…)` apart, `embrace(a, b)` for a hug at
|
|
7767
|
+
`embraceSpacing` and `helpUp(helper, sitter, progress)` for a help-up at
|
|
7768
|
+
`helpUpSpacing`, never two separate clips. See
|
|
7658
7769
|
`docs/character-appearance.md`.
|
|
7659
7770
|
|
|
7660
7771
|
## Surfaces
|
|
@@ -7726,12 +7837,21 @@ them before calling it done:
|
|
|
7726
7837
|
|
|
7727
7838
|
```bash
|
|
7728
7839
|
npx @algorisys/tinyfly video scene.mjs --stills frames --times 0,800,1600,2400
|
|
7840
|
+
npx @algorisys/tinyfly video scene.mjs --loop-check # a looping video: does the frame at the duration match the first?
|
|
7729
7841
|
```
|
|
7730
7842
|
|
|
7731
7843
|
A model that can read images should look at the PNGs: is the hand on the
|
|
7732
7844
|
word, does the figure stand on the line, does the text land where it should?
|
|
7733
7845
|
Fix, render again.
|
|
7734
7846
|
|
|
7847
|
+
**A video that loops** (Shorts, Reels): say `loop: true` on the scene and
|
|
7848
|
+
make every motion a function of `frame.time / frame.period` that repeats
|
|
7849
|
+
exactly: `wobble`, `loopEase`, `loopNoise` for motion, `nestedZoom` for a
|
|
7850
|
+
zoom that steps one level per loop, `bubblePath` with `period`, `beatPulse`
|
|
7851
|
+
on a tempo from `loopBeats`, and `cutAudioToLoop` for the sound. Whole
|
|
7852
|
+
numbers of turns and cycles only; `--loop-check` must say "closes". See the
|
|
7853
|
+
Loops chapter of `docs/video-rendering.md`.
|
|
7854
|
+
|
|
7735
7855
|
## The rules that trip models up
|
|
7736
7856
|
|
|
7737
7857
|
- **Milliseconds in JSON, seconds in the GSAP-style API.** Timeline keyframes
|
|
@@ -7821,7 +7941,7 @@ path for all of that:
|
|
|
7821
7941
|
</figure>
|
|
7822
7942
|
|
|
7823
7943
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
7824
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
7944
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
7825
7945
|
```
|
|
7826
7946
|
|
|
7827
7947
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|
|
@@ -8706,6 +8826,141 @@ The numbers are PSNR (higher is more alike; fast or trembling motion makes
|
|
|
8706
8826
|
every step lower). From code: `checkLoop(scene)` returns the same report, and
|
|
8707
8827
|
`psnr(a, b)` / `loopReport(frames)` work on any RGBA frames.
|
|
8708
8828
|
|
|
8829
|
+
### A scene that loops
|
|
8830
|
+
|
|
8831
|
+
Say so with `loop: true`: the duration is the period. `tinyfly video` then
|
|
8832
|
+
runs the loop check before it encodes anything and stops (exit 1) if the loop
|
|
8833
|
+
does not close; every frame carries `period`, which the periodic helpers and
|
|
8834
|
+
3D trails without a `period` of their own use.
|
|
8835
|
+
|
|
8836
|
+
```js
|
|
8837
|
+
import { wobble, loopNoise, loopEase } from '@algorisys/tinyfly'
|
|
8838
|
+
|
|
8839
|
+
export default {
|
|
8840
|
+
width: 1280, height: 720, duration: 4000, loop: true,
|
|
8841
|
+
draw(ctx, frame) {
|
|
8842
|
+
const sway = wobble(frame.time, { period: frame.period, cycles: 2, amplitude: 12 }) // a sine, two whole cycles
|
|
8843
|
+
const drift = loopNoise(frame.time, { period: frame.period, seed: 'tree' }) * 30 // smooth noise round a circle
|
|
8844
|
+
const breathe = loopEase(frame.time, { period: frame.period, easing: 'ease-in-out' }) // 0 → 1 → 0, eased
|
|
8845
|
+
},
|
|
8846
|
+
}
|
|
8847
|
+
```
|
|
8848
|
+
|
|
8849
|
+
| Helper | Repeats exactly every `period` |
|
|
8850
|
+
|---|---|
|
|
8851
|
+
| `wobble(t, { period, cycles, amplitude, phase, shape })` | A sine (or `triangle`, `square`) with a whole number of cycles |
|
|
8852
|
+
| `loopEase(t, { period, cycles, easing, phase })` | 0 → 1 → 0, the easing on the way up and mirrored down |
|
|
8853
|
+
| `loopNoise(t, { period, seed, cycles, octaves, phase })` | Seeded value noise read round a circle, about −1..1: the end meets the start |
|
|
8854
|
+
| `torusNoise(t, along, { period, periodAlong, seed, … })` | Noise periodic in time and along a length (ripples, grass, a flag) |
|
|
8855
|
+
| `phaseOf(t, period, cycles)`, `pingPong(u)` | The building blocks: where in the cycle, and there-and-back |
|
|
8856
|
+
|
|
8857
|
+
Each is a pure function of time, so frames render in any order and the loop
|
|
8858
|
+
check reports "closes", not "seamless".
|
|
8859
|
+
|
|
8860
|
+
### Sound for a loop
|
|
8861
|
+
|
|
8862
|
+
A loop's sound must come round with its picture. `cutAudioToLoop(file, {
|
|
8863
|
+
output, period, crossfade, fadeIn, fadeOut })` (Node) decodes a drone, a
|
|
8864
|
+
riser or a beat, trims it to the period with its end blended into its start
|
|
8865
|
+
(tiling it first if it is shorter) and writes the WAV to pass as the scene's
|
|
8866
|
+
`audio`; `loopSamples` is the pure step on samples. For motion on the beat,
|
|
8867
|
+
`loopBeats(period, grid)` cuts a tempo to the loop (the nearest whole number
|
|
8868
|
+
of beats, the bpm nudged to fit exactly), `beatPulse(time, grid, { attack,
|
|
8869
|
+
decay, barAccent })` spikes to 1 on every beat and decays, and
|
|
8870
|
+
`beatPeriod(grid, beats)` is the length of so many beats. For motion that
|
|
8871
|
+
follows the sound itself, `audioEnvelope(samples, sampleRate, { fps,
|
|
8872
|
+
smoothing })` gives a level per frame (rising at once, letting go slowly,
|
|
8873
|
+
loudest 1) and `envelopeAt(levels, time, fps, period)` reads it at any time,
|
|
8874
|
+
wrapped for the loop:
|
|
8875
|
+
|
|
8876
|
+
```js
|
|
8877
|
+
import { decodeAudio, cutAudioToLoop } from '@algorisys/tinyfly/headless'
|
|
8878
|
+
import { audioEnvelope, envelopeAt, loopBeats, beatPulse, detectTempo } from '@algorisys/tinyfly'
|
|
8879
|
+
|
|
8880
|
+
const PERIOD = 4000
|
|
8881
|
+
const audio = await cutAudioToLoop('drone.wav', { output: 'build/drone-loop.wav', period: PERIOD, baseDir: here })
|
|
8882
|
+
const samples = await decodeAudio(audio, { sampleRate: 48000 })
|
|
8883
|
+
const levels = audioEnvelope(samples, 48000, { fps: 30 })
|
|
8884
|
+
const { grid } = loopBeats(PERIOD, detectTempo(samples, 48000))
|
|
8885
|
+
export default {
|
|
8886
|
+
width: 1280, height: 720, duration: PERIOD, loop: true, audio,
|
|
8887
|
+
draw(ctx, frame) {
|
|
8888
|
+
const level = envelopeAt(levels, frame.time, 30, frame.period) // 0..1 with the sound
|
|
8889
|
+
const pulse = beatPulse(frame.time, grid) // 1 on each beat, decaying
|
|
8890
|
+
},
|
|
8891
|
+
}
|
|
8892
|
+
```
|
|
8893
|
+
|
|
8894
|
+
### Nested zooms (Droste)
|
|
8895
|
+
|
|
8896
|
+
A picture inside itself, the camera diving in: after one step every level is
|
|
8897
|
+
where the next one was, so a video one step long loops. `similarityAbout(
|
|
8898
|
+
scale, turn, centre)` is the step (a scale, a turn and a move as one value;
|
|
8899
|
+
`powSimilarity(step, k)` is a fraction of it, `composeSimilarity` chains
|
|
8900
|
+
them, `similarityFixedPoint` is the centre everything converges on), and
|
|
8901
|
+
`nestedZoom` draws the levels:
|
|
8902
|
+
|
|
8903
|
+
```js
|
|
8904
|
+
import { similarityAbout } from '@algorisys/tinyfly'
|
|
8905
|
+
import { nestedZoom } from '@algorisys/tinyfly/adapters'
|
|
8906
|
+
|
|
8907
|
+
const step = similarityAbout(0.5, 12, { x: 640, y: 360 })
|
|
8908
|
+
export default {
|
|
8909
|
+
width: 1280, height: 720, duration: 3000, loop: true, background: '#05030c',
|
|
8910
|
+
draw(ctx, frame) {
|
|
8911
|
+
nestedZoom(ctx, {
|
|
8912
|
+
step,
|
|
8913
|
+
phase: frame.time / frame.period, // 0..1: how far into one step
|
|
8914
|
+
extent: 1600, // how far a level's drawing reaches at level 0, px
|
|
8915
|
+
coversAbove: 1.1, // a level this big fills the frame: nothing behind it is drawn
|
|
8916
|
+
draw(ctx, level, scale) { drawFrame(ctx, level) }, // in level-0 coordinates
|
|
8917
|
+
})
|
|
8918
|
+
},
|
|
8919
|
+
}
|
|
8920
|
+
```
|
|
8921
|
+
|
|
8922
|
+
Levels smaller than `minSize` px (default 1) are skipped, and so is
|
|
8923
|
+
everything behind a level at or above `coversAbove`, so a zoom of twenty
|
|
8924
|
+
levels draws the five or six that show. `draw` gets the level number (0 is
|
|
8925
|
+
the one at natural size at phase 0, 1 the one inside it) and its screen
|
|
8926
|
+
scale, to keep line widths readable; colour or detail that should travel with
|
|
8927
|
+
the zoom is a function of `level - phase`. `examples/headless-video/nested-zoom.mjs`
|
|
8928
|
+
is a looping neon zoom built this way; `nestedZoomTransform(step, level,
|
|
8929
|
+
phase)` gives a level's similarity for drawing it some other way.
|
|
8930
|
+
|
|
8931
|
+
A Droste *face*: `drawCharacterHead` draws a character's head big, and its
|
|
8932
|
+
`face.inPupil` hook draws inside each pupil, clipped to it, so the head can
|
|
8933
|
+
hold itself (see [Close-ups](character-appearance.md#close-ups)). Anything
|
|
8934
|
+
that should change with a level's size on screen rather than with time (the
|
|
8935
|
+
eyes opening as a head grows, a colour cooling with depth) is a `curve`:
|
|
8936
|
+
`curve([{ at: 20, value: 0 }, { at: 300, value: 1, easing: 'ease-out' }])(radius)`
|
|
8937
|
+
reads keyframes and easings at any input, holding beyond its ends.
|
|
8938
|
+
|
|
8939
|
+
### Dives and impossible objects
|
|
8940
|
+
|
|
8941
|
+
Two post-effects for a dive, both deterministic. `applyZoomBlur(ctx, { centre,
|
|
8942
|
+
strength, samples, blend })` streaks the finished frame out from a point (a
|
|
8943
|
+
fixed set of scaled copies, averaged, or added with `blend: 'add'` for neon);
|
|
8944
|
+
`drawDiveLines(ctx, { centre, count, inner, outer, length, phase, seed, color,
|
|
8945
|
+
blend })` streams seeded lines past the camera, and `phase: phaseOf(time,
|
|
8946
|
+
period)` moves them one line along per loop so they repeat exactly.
|
|
8947
|
+
|
|
8948
|
+
The impossible objects are built the way the sculptures are: real boxes that
|
|
8949
|
+
line up from one viewpoint. `penroseTriangle({ size, thickness, centre, scale })`
|
|
8950
|
+
and `penroseStairs({ steps, tread, rise, width, base, centre, scale })` give
|
|
8951
|
+
boxes and their visible faces in drawing order for the isometric view (along
|
|
8952
|
+
the (1, 1, 1) diagonal, z up); `drawIsometricFaces(ctx, faces, { top, left,
|
|
8953
|
+
right, fill, outline })` fills them. The triangle's third beam ends one
|
|
8954
|
+
diagonal from where the first began, so on screen the loop closes (the first
|
|
8955
|
+
beam is drawn again over the third's end); the stairs climb all the way round
|
|
8956
|
+
and the last step meets the first. `projectIsometric`, `isometricBoxFaces`
|
|
8957
|
+
and `isometricFaces` are the building blocks for your own. In a 3D scene,
|
|
8958
|
+
`penroseTriangle3D({ length, thickness, material })` returns the three beams
|
|
8959
|
+
and an orthographic camera down the diagonal: from it the loop closes, from
|
|
8960
|
+
anywhere else it is three beams (its third corner shows the beams' ends,
|
|
8961
|
+
as a real sculpture's does; a `rotateY` track on a group round it breaks and
|
|
8962
|
+
remakes the illusion).
|
|
8963
|
+
|
|
8709
8964
|
## Bloom
|
|
8710
8965
|
|
|
8711
8966
|
`bloom: true` (or options) adds a glow around everything bright, after each
|
|
@@ -8782,6 +9037,25 @@ beads where segments overlap and no seams between them. `ribbon(points)` and
|
|
|
8782
9037
|
`line` and `trail` objects, sorted by depth among the meshes (see
|
|
8783
9038
|
[3D Scenes](scene-3d.md#lines-and-trails)).
|
|
8784
9039
|
|
|
9040
|
+
## Satisfying matter
|
|
9041
|
+
|
|
9042
|
+
Goo as geometry, every shape a pure function of its inputs:
|
|
9043
|
+
|
|
9044
|
+
| Helper | Gives |
|
|
9045
|
+
|---|---|
|
|
9046
|
+
| `metaballContours(balls, { threshold, cell, smooth })` | The outlines of balls (`{ x, y, r }`) that merge through necks as they near and split as they part, as closed polygons; `metaballField` is the field itself |
|
|
9047
|
+
| `dripPath({ x, y, length, width, progress })` | A drip under a surface: a neck thinning to a thread and a head swelling as `progress` runs 0 → 1 |
|
|
9048
|
+
| `bubblePath({ x, y, r, grow, time, period, wobble })` | A bubble growing from nothing (with a little swell on the way) whose surface quivers with the time; with `period` the quiver repeats exactly |
|
|
9049
|
+
| `bubblePop({ x, y, r, progress, pieces })` | The pop: arcs of the rim flying out and shrinking, gone at 1 |
|
|
9050
|
+
| `squashStretch(amount, { keep })`, `scalePoints(points, scale, about)` | Stretch taller (or squash, negative) with the width giving way so the area (or the `volume`) stays; apply it about the point a blob lands on |
|
|
9051
|
+
|
|
9052
|
+
```js
|
|
9053
|
+
draw(ctx, frame) {
|
|
9054
|
+
const balls = [{ x: 400, y: 300, r: 60 }, { x: 400 + wobble(frame.time, { period: frame.period, amplitude: 90 }), y: 300, r: 40 }]
|
|
9055
|
+
for (const loop of metaballContours(balls, { cell: 3 })) fillPolygon(ctx, loop, '#b6ff3b')
|
|
9056
|
+
}
|
|
9057
|
+
```
|
|
9058
|
+
|
|
8785
9059
|
## Camera, overlay and drawing on twos
|
|
8786
9060
|
|
|
8787
9061
|
- `camera: true` sees the scene through the tracks of the `Camera` target:
|
|
@@ -8896,8 +9170,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
8896
9170
|
adds to the same `tinyfly` global:
|
|
8897
9171
|
|
|
8898
9172
|
```html
|
|
8899
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8900
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
9173
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly.iife.js"></script>
|
|
9174
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.101.0/cdn/tinyfly-maps.iife.js"></script>
|
|
8901
9175
|
```
|
|
8902
9176
|
|
|
8903
9177
|
It is a separate script because the offline world map it carries adds about
|
|
@@ -9289,6 +9563,11 @@ Beards: `none`, `stubble`, `goatee`, `soulPatch`, `chinStrap`, `circle`,
|
|
|
9289
9563
|
The crown sits over the hair; hair below the brim still shows.
|
|
9290
9564
|
- `ears: true` adds ears: they stick out past the head from the front and
|
|
9291
9565
|
behind, and sit on the head with a curl when turned toward the viewer.
|
|
9566
|
+
- `face: { teeth: true, tongue: true }` shows a row of upper teeth hanging
|
|
9567
|
+
from the top of the mouth, and a tongue lying in the bottom of it, whenever
|
|
9568
|
+
the mouth opens past 0.3 (a laugh, a shout, a wail). The mouth's shape is
|
|
9569
|
+
still the pose's `mouth`, `smile` and `mouthWidth`; a closed or barely open
|
|
9570
|
+
mouth shows neither. Default: neither, so a plain face draws as before.
|
|
9292
9571
|
|
|
9293
9572
|
## Builds
|
|
9294
9573
|
|
|
@@ -9305,9 +9584,16 @@ field can still be set on its own (`headSize`, `shoulderWidth`, `hipWidth`,
|
|
|
9305
9584
|
| `broad`, `curvy`, `stocky` | Shoulder and hip widths (stocky: a larger head) |
|
|
9306
9585
|
| `kid`, `child`, `toddler` | Larger head, shorter limbs |
|
|
9307
9586
|
|
|
9587
|
+
`feet` sets the feet's shape: `round` (the default blob), `flat` (a shoe,
|
|
9588
|
+
longer and even), `pointed` (a slipper, tapering to the toe) or `big` (clown's
|
|
9589
|
+
feet, half as long again and wide). The shape is clearest in profile, where
|
|
9590
|
+
the foot points along the ground; from the front it points at the viewer.
|
|
9591
|
+
|
|
9308
9592
|
Age, posture and accessories are separate choices: a child build is only
|
|
9309
9593
|
proportions, and an older character is shown by hair and glasses, never by a
|
|
9310
|
-
stoop unless one is posed.
|
|
9594
|
+
stoop unless one is posed. A cane (`holding: { right: 'cane' }`) and a
|
|
9595
|
+
wheelchair (the `wheelchair()` prop, ridden in the `wheeling` pose) are
|
|
9596
|
+
accessories any character can have, not part of an age. The same poses, gaits and actions work on every
|
|
9311
9597
|
build; `humanGaitStrideLength(gait, height, stride, legLength)` gives a build's
|
|
9312
9598
|
stride so its feet stay planted.
|
|
9313
9599
|
|
|
@@ -9328,7 +9614,8 @@ character({ outfit: { over: 'labCoat' } })
|
|
|
9328
9614
|
| `bottom` | `trousers` (default), `shorts`, `skirt` |
|
|
9329
9615
|
| `collar` | `true` for a shirt collar |
|
|
9330
9616
|
| `tie` | A colour, for a tie down the front |
|
|
9331
|
-
| `over`, `overColor` | `apron` or `
|
|
9617
|
+
| `over`, `overColor` | `apron`, `labCoat`, `hoodie` (a loose top with a hood at the back, a front pocket and long sleeves), `cardigan` (open down the front, buttoned), `overalls` (a bib with straps, in the trousers' colour) or `sari` (a drape to the ankles with the pallu over the near shoulder), and its colour |
|
|
9618
|
+
| `shoes`, `shoeColor` | `boots` to above the ankle, and their colour |
|
|
9332
9619
|
|
|
9333
9620
|
The front details (collar, tie, apron, the coat's opening) show from the
|
|
9334
9621
|
front and turn away with the body; from behind an apron shows its ties.
|
|
@@ -9347,6 +9634,28 @@ family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
|
|
|
9347
9634
|
const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
|
|
9348
9635
|
```
|
|
9349
9636
|
|
|
9637
|
+
## Hugs, help-ups and everyday cycles
|
|
9638
|
+
|
|
9639
|
+
Two people, more than hands: `embrace(a, b)` is a hug. Both turn toward each
|
|
9640
|
+
other, lean in and tilt their heads together, and each reaches its right arm
|
|
9641
|
+
over the other's shoulder and its left round the other's waist, exactly, from
|
|
9642
|
+
where the two stand (`embraceSpacing(a, b)` apart). `helpUp(helper, sitter,
|
|
9643
|
+
progress)` is one person helping another up off the floor as a function of how
|
|
9644
|
+
far along it is: at 0 the sitter sits on the floor and the helper bows to take
|
|
9645
|
+
its hand, at 1 both stand, and in between the hands stay joined at a point
|
|
9646
|
+
that rises with them (`helpUpSpacing(helper, sitter)` apart). Both return
|
|
9647
|
+
plain poses (`a`, `b`, or `helper`, `sitter`) and whether they `reached`.
|
|
9648
|
+
|
|
9649
|
+
```js
|
|
9650
|
+
const hug = embrace({ character: cook, x: 300 }, { character: grandpa, x: 300 + embraceSpacing(cook, grandpa) })
|
|
9651
|
+
const rising = helpUp({ character: cook, x: 300 }, { character: grandpa, x: 300 + helpUpSpacing(cook, grandpa) }, 0.5)
|
|
9652
|
+
```
|
|
9653
|
+
|
|
9654
|
+
Everyday actions as cycles, like a gait: `humanCyclePose('sweeping', phase,
|
|
9655
|
+
base)` sweeps a broom side to side (hold one: `holding: { right: 'broom' }`)
|
|
9656
|
+
and `'brushing'` works a hand across a surface in front at chest height; `phase`
|
|
9657
|
+
0 → 1 is one stroke and back. The Help Up card shows all three.
|
|
9658
|
+
|
|
9350
9659
|
## Expressions and face marks
|
|
9351
9660
|
|
|
9352
9661
|
`HUMAN_EXPRESSIONS` sets every face field, so applying one replaces the whole
|
|
@@ -9362,6 +9671,32 @@ tracks animate them): `blush` (rosy cheeks, with hatch lines past 0.5),
|
|
|
9362
9671
|
`tears` (a drop under each eye, running down past 0.6) and `sweat` (a bead at
|
|
9363
9672
|
the temple).
|
|
9364
9673
|
|
|
9674
|
+
## Close-ups
|
|
9675
|
+
|
|
9676
|
+
For a face filling the frame there are three more pose fields and a bigger
|
|
9677
|
+
drawing:
|
|
9678
|
+
|
|
9679
|
+
- `pupil` (1 the usual size): bigger for excitement or a dive into it,
|
|
9680
|
+
smaller for fear. `lid` (0..1) lowers the upper lids over the eye (sleepy,
|
|
9681
|
+
suspicious, bored). `bulge` (0..1) pops the eyes out of the head, whites and
|
|
9682
|
+
all. `scared`, `afraid`, `sleepy`, `suspicious` and `excited` use them.
|
|
9683
|
+
- `face: { nose: true }` adds a small nose; `face: { teeth, tongue }` are
|
|
9684
|
+
above.
|
|
9685
|
+
- `drawCharacterHead(ctx, who, pose, { x, y, radius, time })` draws just the
|
|
9686
|
+
head (hair, hat, glasses, ears, the face), its centre at `x`, `y` and its
|
|
9687
|
+
radius `radius` px, in the character's look with the line weight scaled to
|
|
9688
|
+
the size. The pose turns and nods it and sets the face.
|
|
9689
|
+
- `face: { inPupil(ctx, pupil) }` draws inside each pupil, the context
|
|
9690
|
+
clipped to its circle on screen (`{ x, y, r, side }`): another scene, or the
|
|
9691
|
+
same head again for a Droste face:
|
|
9692
|
+
|
|
9693
|
+
```js
|
|
9694
|
+
function head(ctx, x, y, r, depth = 0) {
|
|
9695
|
+
const who = character({ hair: 'spiky', face: { nose: true, inPupil: depth < 4 ? (c, p) => head(c, p.x, p.y, p.r, depth + 1) : undefined } })
|
|
9696
|
+
drawCharacterHead(ctx, who, humanPose({ bulge: 0.9, pupil: 1.5 }), { x, y, radius: r })
|
|
9697
|
+
}
|
|
9698
|
+
```
|
|
9699
|
+
|
|
9365
9700
|
## Everyday actions, held items and meeting hands
|
|
9366
9701
|
|
|
9367
9702
|
The motion and everyday-life sheets add poses to `HUMAN_POSES`: `sleep`,
|
|
@@ -9377,11 +9712,14 @@ character({ holding: { left: 'bag', right: 'bag' } }) // carry
|
|
|
9377
9712
|
character({ holding: { both: { item: 'parcel', color: '#c9a06a' } } })
|
|
9378
9713
|
```
|
|
9379
9714
|
|
|
9380
|
-
Items: `mug`, `phone`, `briefcase`, `bag`, `umbrella` and `
|
|
9381
|
-
`left` or `right`), `book` (one hand or `both`) and `parcel` (`both`). Each is
|
|
9715
|
+
Items: `mug`, `phone`, `briefcase`, `bag`, `umbrella`, `broom` and `cane` (one
|
|
9716
|
+
hand, `left` or `right`), `book` (one hand or `both`) and `parcel` (`both`). Each is
|
|
9382
9717
|
drawn at the hand's grip, so it follows the hand through any pose, gait or
|
|
9383
9718
|
turn, and sorts with that arm (a mug goes behind the body with the far arm).
|
|
9384
|
-
An umbrella's canopy sits just over the head.
|
|
9719
|
+
An umbrella's canopy sits just over the head. A cane's crook is in the hand
|
|
9720
|
+
and its shaft reaches the ground while the hand hangs, lifting with the hand
|
|
9721
|
+
once it rises; `HUMAN_POSES.cane` stands leaning on it (the arm straight, a
|
|
9722
|
+
little ahead), and any gait walks with it. `handGrip(joints, side)` gives
|
|
9385
9723
|
the grip point and the forearm's direction for drawing anything else in a
|
|
9386
9724
|
hand.
|
|
9387
9725
|
|
|
@@ -9409,8 +9747,8 @@ const give = meetHands('handOver', { character: courier, x: 300 }, { character:
|
|
|
9409
9747
|
|
|
9410
9748
|
Select a 🧍 Character and open **Head** in the properties: **Cast** dresses it
|
|
9411
9749
|
as a cast member (build, hair, facial hair, glasses and clothes in one step),
|
|
9412
|
-
then **Hair**, **Hair colour**, **Facial hair**, **Glasses**, **Hat
|
|
9413
|
-
**Ears** change one thing at a time; **Right hand**, **Left hand** and **Both
|
|
9750
|
+
then **Hair**, **Hair colour**, **Facial hair**, **Glasses**, **Hat**,
|
|
9751
|
+
**Ears**, **Teeth**, **Tongue** and **Feet** change one thing at a time; **Right hand**, **Left hand** and **Both
|
|
9414
9752
|
hands** put an item in them. **Build** lists the builds, with **Legs** and
|
|
9415
9753
|
**Arms** sliders. The new expressions and everyday poses are in the **Face**
|
|
9416
9754
|
and **Body** lists. All of it is saved as plain fields on the element and
|
|
@@ -9721,9 +10059,13 @@ overshoots and overlaps on this body, and the lines are lip-synced over its
|
|
|
9721
10059
|
mouth. The walk phase is rekeyed to the character's own stride (its height and
|
|
9722
10060
|
legs: a child takes shorter steps), so its feet stay planted. The `walk`,
|
|
9723
10061
|
`walking` and `gait` tracks step the gait as the target draws
|
|
9724
|
-
(`characterPoseOf(props)` folds them into the pose, for drawing by hand).
|
|
9725
|
-
|
|
9726
|
-
|
|
10062
|
+
(`characterPoseOf(props)` folds them into the pose, for drawing by hand). Reaches
|
|
10063
|
+
are planned for the character's own arms and legs (`reach`, the share of the
|
|
10064
|
+
stick figure's reach its limbs have, so it steps to where they reach), and
|
|
10065
|
+
while a beat's hand or foot is on its target the limb is re-aimed on the
|
|
10066
|
+
human body: a `point` aims at the spot, a `grab`, `put` or `kick` lands on it
|
|
10067
|
+
(leaning down to a low one), and a `swipe`, `write` or `push` follows where
|
|
10068
|
+
the stick figure's palm went. Your own gaits go in
|
|
9727
10069
|
`options.gaits` for the script and `gaits` on `characterTarget` so the drawing
|
|
9728
10070
|
knows them too.
|
|
9729
10071
|
|
|
@@ -10195,9 +10537,9 @@ timeline plays: editor previews, players, embeds and exports.
|
|
|
10195
10537
|
|
|
10196
10538
|
## Not yet
|
|
10197
10539
|
|
|
10198
|
-
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10540
|
+
- Beat scripts for v2 characters acting on surfaces directly (`surfaceScript`
|
|
10541
|
+
drives the stick figure; in the editor, a Character's Beats box resolves
|
|
10542
|
+
surface places and cues for it)
|
|
10201
10543
|
|
|
10202
10544
|
---
|
|
10203
10545
|
|
|
@@ -10582,7 +10924,7 @@ number or three), `parent` (an earlier object it moves with), `visible`, and
|
|
|
10582
10924
|
|---|---|
|
|
10583
10925
|
| `group` | (just a transform: move several objects together, or carry a camera) |
|
|
10584
10926
|
| `mesh` | `geometry`, `material` (a key of `materials`) |
|
|
10585
|
-
| `camera` | `projection: 'perspective'` with `fov` (vertical, degrees), or `'orthographic'` with `height` (metres); `near`, `far`; optional `lookAt: [x, y, z]` |
|
|
10927
|
+
| `camera` | `projection: 'perspective'` with `fov` (vertical, degrees), or `'orthographic'` with `height` (metres); `near`, `far`; optional `lookAt: [x, y, z]`, `up` (which way is up for it, default +y) and `roll` (degrees about the view axis, clockwise on screen) |
|
|
10586
10928
|
| `light` | `light: 'ambient' \| 'directional' \| 'point' \| 'spot'`, `color`, `intensity` (1 is full light); directional and spot shine from their position toward `target` (default the origin); point and spot fade to nothing at `range`; spot's cone is `angle` (half-angle, default 30°) |
|
|
10587
10929
|
|
|
10588
10930
|
**Geometry**: `box` (`size: [w, h, d]`), `sphere` (`radius`, `segments`),
|
|
@@ -10592,7 +10934,11 @@ facing up, `segments` per side), and `extrude`: any SVG `path` made solid,
|
|
|
10592
10934
|
`depth` metres thick and scaled to `width` metres wide (default 1), with
|
|
10593
10935
|
`curveSegments` points per curve (default 12). Subpaths inside others are
|
|
10594
10936
|
holes (an "o", a ring); outlines inside holes are solid again. The path's y
|
|
10595
|
-
(down) is flipped to 3D's y (up). All centred on the origin.
|
|
10937
|
+
(down) is flipped to 3D's y (up). All centred on the origin. A raw `mesh`
|
|
10938
|
+
takes `positions` (flat x, y, z runs), `indices` (triples, counter-clockwise
|
|
10939
|
+
from outside), optional `normals` per vertex (flat ones are computed) and
|
|
10940
|
+
`colors`, one per face or one per vertex (blended per face), over the
|
|
10941
|
+
material's colour: warped beams, terrain, anything exported from a tool.
|
|
10596
10942
|
|
|
10597
10943
|
```js
|
|
10598
10944
|
{ id: 'star', kind: 'mesh', material: 'gold',
|
|
@@ -10618,7 +10964,9 @@ milestone); the stylized renderers ignore them, so one material serves both.
|
|
|
10618
10964
|
|
|
10619
10965
|
The scene can have `background` and `fog: { color, near, far }` (metres from
|
|
10620
10966
|
the camera). A scene with no lights gets a soft default (ambient plus a key
|
|
10621
|
-
light from upper right).
|
|
10967
|
+
light from upper right). Outlines fade into the fog too. `nearFade: { from, to }` fades geometry
|
|
10968
|
+
nearer the camera than `to` metres, gone at `from`, so a dive passes through
|
|
10969
|
+
things as if they were glass (also an option of `resolveScene3D`).
|
|
10622
10970
|
|
|
10623
10971
|
## Animating it
|
|
10624
10972
|
|
|
@@ -10633,8 +10981,9 @@ live in the same timeline as everything else.
|
|
|
10633
10981
|
| `visible` | any object | 0 or 1 (children hide with their parent) |
|
|
10634
10982
|
| `opacity` | meshes | 0..1, times the material's |
|
|
10635
10983
|
| `color` | meshes, lights | a colour, over the material's or light's |
|
|
10984
|
+
| `outlineWidth`, `outlineColor` | meshes | px and a colour, over the material's outline (0 switches it off) |
|
|
10636
10985
|
| `intensity`, `target` | lights | |
|
|
10637
|
-
| `fov` / `height`, `lookAt` | cameras | |
|
|
10986
|
+
| `fov` / `height`, `lookAt`, `roll` | cameras | |
|
|
10638
10987
|
| `color`, `width`, `opacity` | lines, trails | |
|
|
10639
10988
|
| `length` | trails | ms |
|
|
10640
10989
|
| `activeCamera` | the scene, target `<sceneId>` | a camera's id: **a cut is one keyframe** |
|
|
@@ -10919,6 +11268,18 @@ objects, prepares them once, and each frame returns meshes (shaded and sorted
|
|
|
10919
11268
|
with the scene's) and drawables (drawn whole at their depth). Pass it in
|
|
10920
11269
|
`loadScene3D(scene, { kinds })`.
|
|
10921
11270
|
|
|
11271
|
+
## Impossible objects
|
|
11272
|
+
|
|
11273
|
+
`penroseTriangle3D({ length, thickness, material, id, position, distance })`
|
|
11274
|
+
returns three box objects (beams along x, up y and along z, each starting
|
|
11275
|
+
where the last ends) and an orthographic camera on the (1, 1, 1) diagonal
|
|
11276
|
+
from which the third beam's end meets the first's start on screen. Add the
|
|
11277
|
+
objects with a material of that name and the camera, or place your own camera
|
|
11278
|
+
along the diagonal; from anywhere else the loop is open. The third corner
|
|
11279
|
+
shows the beams' ends as a real sculpture's does. For a clean drawing see the
|
|
11280
|
+
2D `penroseTriangle` and `penroseStairs` in
|
|
11281
|
+
[Video from code](video-rendering.md#dives-and-impossible-objects).
|
|
11282
|
+
|
|
10922
11283
|
## The WebGL2 renderer
|
|
10923
11284
|
|
|
10924
11285
|
`@algorisys/tinyfly/scene-3d/webgl` (`tinyfly-scene-3d-webgl.iife.js` for
|
|
@@ -13404,7 +13765,7 @@ magnet.addEventListener('pointerleave', () => {
|
|
|
13404
13765
|
|
|
13405
13766
|
<!-- capabilities: generated from the library -->
|
|
13406
13767
|
|
|
13407
|
-
# tinyfly capabilities (v0.
|
|
13768
|
+
# tinyfly capabilities (v0.101.0)
|
|
13408
13769
|
|
|
13409
13770
|
Generated from the library itself: every name below is accepted, and names not listed are rejected (beat scripts, code panels and `checkTracks` say which name was probably meant).
|
|
13410
13771
|
|
|
@@ -13628,7 +13989,7 @@ A prop is a 3D rig of simple parts drawn with the characters’ pens (clean, pen
|
|
|
13628
13989
|
- `songbird() · crow() · chicken()`: birds (bird(spec) makes your own): hop, walk, peck, flap, fly and land (a chicken flutters), their calls; wings fold and beat in rhythm
|
|
13629
13990
|
- `{ kind: 'prop', prop: 'car', position, rotation, values } with loadScene3D(scene, { kinds: [characterObjects, propObjects] })`: props in 3D scenes, by preset name, seen in perspective by the scene camera; controls are tracks on the object
|
|
13630
13991
|
- `characterScript3D(id, beats, { scene, position?, heading?, height?, pose? })`: a v2 character in a 3D scene in world metres: gaits to [x, z] or through points (its walk phase keyed with the distance), face, hold, pose, gag; checkCharacterBeats3D checks the beats
|
|
13631
|
-
- `propRide3D({ prop, propId, propTracks, scene, placement, anchor, riderId, pose, start, end, mount?, dismount? })`: a character riding a prop in a 3D scene: hips on a seat anchor (saddle, seat) as it moves, hopping on and off; RIDING_POSES.astride / .seated
|
|
13992
|
+
- `propRide3D({ prop, propId, propTracks, scene, placement, anchor, riderId, pose, start, end, mount?, dismount? })`: a character riding a prop in a 3D scene: hips on a seat anchor (saddle, seat) as it moves, hopping on and off; RIDING_POSES.astride / .seated / .driving / .cycling / .wheeling (a wheelchair)
|
|
13632
13993
|
- `propScript3D(id, prop, beats, { scene, position?, heading?, values? })`: props scripted in world metres for 3D scenes: moves to [x, z] or through points (wheels and strides keyed with the distance), face, hold, and their actions; checkPropBeats3D checks the beats
|
|
13633
13994
|
- `propPreset(name, options?)`: a prop preset by name (did-you-mean on a wrong one)
|
|
13634
13995
|
- `propTarget({ …, style: 'stick' })`: line art to go with stick figures: tubes as single strokes, shapes outlined over paper
|
|
@@ -13642,6 +14003,8 @@ A prop is a 3D rig of simple parts drawn with the characters’ pens (clean, pen
|
|
|
13642
14003
|
|
|
13643
14004
|
Prop beat fields: `do`, `at`, `for`, `to`, `toward`, `speed`, `open`, `on`, `height`, `wind`. Every prop has the controls `turn`, `tilt`, `pitch`, `roll`, `squash`, `lift`, `lean`, `size` and the actions `hold`, `turn`, `pop`, `vanish`.
|
|
13644
14005
|
|
|
14006
|
+
Scenery: `scenery({ x, y, width, height, kind: sky | room, hour, clouds, wind, rain, snow, horizon: hills | city | flat })` is a canvas target whose values `hour` (0–24), `clouds`, `rain`, `snow` (0–1) and `wind` (−1..1) are tracks (`set(prop, { at, value, duration })`, `tracks(id)`; `anchor('sun' | 'moon' | 'horizon' | 'ground', time)`); the same `wind` streams hair (`hairFollowTracks(…, { wind })`). `scenePreset('park' | 'street' | 'office' | 'home', { width, height })` lays out scenery and props as data; `buildScene` builds them into targets.
|
|
14007
|
+
|
|
13645
14008
|
| Preset | Family | Actions (needs) | Controls | Anchors |
|
|
13646
14009
|
|---|---|---|---|---|
|
|
13647
14010
|
| `car()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `door` (open), `lights` (on) | `wheelSpin`, `door`, `lights`, `antenna` | seat, front, back, roof, door |
|
|
@@ -13654,32 +14017,45 @@ Prop beat fields: `do`, `at`, `for`, `to`, `toward`, `speed`, `open`, `on`, `hei
|
|
|
13654
14017
|
| `motorbike()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `lights` (on) | `wheelSpin`, `lights` | seat, front, back, roof |
|
|
13655
14018
|
| `tree()` | plant | `sway`, `shake`, `shedLeaves` | `sway`, `canopySway` | canopy, top, base, branch |
|
|
13656
14019
|
| `house()` | building | `door` (open), `lights` (on), `shake`, `smoke` | `door`, `lights` | door, doorstep, ridge, chimney |
|
|
14020
|
+
| `chair()` | furniture | `tip`, `fall` | `tip` | seat, back, front |
|
|
14021
|
+
| `desk()` | furniture | `drawer` (open) | `drawer` | top, edge, drawer, chair |
|
|
14022
|
+
| `bed()` | furniture | `bounce` | `give` | mattress, pillow, foot, side |
|
|
14023
|
+
| `door()` | furniture | `open`, `slam`, `knock` | `open` | handle, doorway, front, beyond |
|
|
14024
|
+
| `wheelchair()` | furniture | `roll` (to), `brake` (to), `wheelie` | `wheelSpin`, `tip` | seat, handles, front, footrest |
|
|
13657
14025
|
| `helicopter()` | aircraft | `takeOff`, `fly` (to), `hover`, `land` | `rotor`, `blur` | seat, door, rotor, skids, hook |
|
|
13658
14026
|
| `airplane()` | aircraft | `takeOff` (to), `fly` (to), `loop`, `land` (to) | `rotor`, `blur` | seat, nose, tail, wingtip |
|
|
13659
14027
|
| `horse()` | animal | `walk` (to), `trot` (to), `canter` (to), `gallop` (to), `neigh`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze`, `rear`, `buck` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, hitch, saddle |
|
|
13660
14028
|
| `dog()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `bark`, `sit`, `lie`, `jump`, `nod`, `swish`, `wag`, `sniff` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, leash |
|
|
13661
14029
|
| `cat()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `meow`, `sit`, `lie`, `jump`, `nod`, `swish`, `arch`, `pounce` (to) | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
13662
14030
|
| `cow()` | animal | `walk` (to), `trot` (to), `moo`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
13663
|
-
| `
|
|
13664
|
-
| `
|
|
13665
|
-
| `
|
|
14031
|
+
| `goat()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `bleat`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
14032
|
+
| `rabbit()` | animal | `walk` (to), `run` (to), `gallop` (to), `squeak`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
14033
|
+
| `squirrel()` | animal | `walk` (to), `run` (to), `gallop` (to), `chatter`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `ears`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
14034
|
+
| `songbird()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `tweet`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
14035
|
+
| `crow()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `caw`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
14036
|
+
| `chicken()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `cluck`, `flutter` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
14037
|
+
| `pigeon()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `coo`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
14038
|
+
| `duck()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `quack`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
14039
|
+
| `owl()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `hoot`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
14040
|
+
| `parrot()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `squawk`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right`, `grip` | beak, head, back, feet |
|
|
13666
14041
|
|
|
13667
14042
|
## Character (v2 human)
|
|
13668
14043
|
|
|
13669
|
-
Poses: `rest`, `wave`, `cheer`, `point`, `handsOnHips`, `think`, `shrug`, `sit`, `kneel`, `crouch`, `crawl`, `lieDown`, `sleep`, `stretch`, `sitFloor`, `carry`, `lift`, `push`, `pull`, `drink`, `phone`, `read`, `type`. Expressions: `neutral`, `happy`, `joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`, `worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`, `disgusted`, `smug`, `wink`, `laughing`, `afraid`, `bored`, `tired`, `embarrassed`, `proud`, `determined`, `affectionate`, `hurt`, `suspicious`, `relieved`, `excited`. Gags: `take`, `doubleTake`, `windUp`, `land`, `tremble`, `deflate`.
|
|
14044
|
+
Poses: `rest`, `wave`, `cheer`, `point`, `handsOnHips`, `think`, `shrug`, `sit`, `kneel`, `crouch`, `crawl`, `lieDown`, `sleep`, `stretch`, `sitFloor`, `carry`, `cane`, `lift`, `push`, `pull`, `drink`, `phone`, `read`, `type`. Expressions: `neutral`, `happy`, `joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`, `worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`, `disgusted`, `smug`, `wink`, `laughing`, `afraid`, `bored`, `tired`, `embarrassed`, `proud`, `determined`, `affectionate`, `hurt`, `suspicious`, `relieved`, `excited`. Gags: `take`, `doubleTake`, `windUp`, `land`, `tremble`, `deflate`.
|
|
13670
14045
|
|
|
13671
14046
|
Appearance options of `character({ … })`, all plain data that turns with the head (see docs/character-appearance.md):
|
|
13672
14047
|
|
|
13673
14048
|
- `build`: `standard`, `slim`, `tall`, `short`, `broad`, `curvy`, `stocky`, `kid`, `child`, `toddler`
|
|
13674
14049
|
- `hair`: `bald`, `buzzCut`, `crewCut`, `short`, `sidePart`, `sideSwept`, `slickBack`, `quiff`, `spiky`, `undercut`, `curlyCrop`, `afro`, `wavyCrop`, `shortLocs`, `flatTop`, `receding`, `thinning`, `pixie`, `bob`, `longBob`, `wavyBob`, `shoulderStraight`, `shoulderWaves`, `longStraight`, `longWaves`, `longCurls`, `longLocs`, `lowPonytail`, `highPonytail`, `ponytail`, `sidePonytail`, `topBun`, `lowBun`, `singleBraid`, `twinBraids`, `braids` (colours: `black`, `brown`, `chestnut`, `auburn`, `blond`, `ginger`, `gray`, `white` in `HAIR_COLORS`)
|
|
13675
14050
|
- `facialHair`: `cleanShaven`, `stubble`, `pencilMoustache`, `shortMoustache`, `chevron`, `handlebar`, `walrus`, `goatee`, `vanDyke`, `circleBeard`, `shortBoxed`, `fullBeard`, `longBeard`, `roundedBeard`, `pointedBeard`, `chinStrap`, `soulPatch`, `sideburns`, `muttonChops`, `moustacheStubble`
|
|
13676
|
-
- `glasses`: `round`, `square`, `sunglasses`; `hat`: `cap`, `beanie`, `hardHat`, `sunHat`, `bowler`; `ears: true`
|
|
13677
|
-
- `outfit`: `{ shirt, trousers, sleeves: short | long | none, bottom: trousers | shorts | skirt, collar, tie: colour, over: apron | labCoat, overColor }`
|
|
14051
|
+
- `glasses`: `round`, `square`, `sunglasses`; `hat`: `cap`, `beanie`, `hardHat`, `sunHat`, `bowler`; `ears: true`; `face: { teeth, tongue }` (shown when the mouth opens); `feet`: `round`, `flat`, `pointed`, `big`
|
|
14052
|
+
- `outfit`: `{ shirt, trousers, sleeves: short | long | none, bottom: trousers | shorts | skirt, collar, tie: colour, over: apron | labCoat | hoodie | cardigan | overalls | sari, overColor, shoes: boots, shoeColor }`
|
|
13678
14053
|
- `castMember(name, height)`: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`, `grandma`, `doctor`, `cook`, `builder`, `courier`, `teacher`, `farmer`
|
|
13679
|
-
- Face marks (pose fields, 0–1): `blush`, `tears`, `sweat`
|
|
14054
|
+
- Face marks (pose fields, 0–1): `blush`, `tears`, `sweat`; close-up fields `pupil` (size, 1 usual), `lid` (upper lids lowered, 0–1), `bulge` (eyes out of the head, 0–1); `face: { nose: true, inPupil(ctx, pupil) }`; `drawCharacterHead(ctx, who, pose, { x, y, radius })` draws just the head big
|
|
13680
14055
|
- Hair in motion (pose fields): `hair.swing` (degrees round the head, + toward its left), `hair.trail` (head radii back), `hair.lift` (head radii up); key them with `hairFollowTracks(target, tracks, who)` after the character's tracks, or `hairFollow` + `hairMotionAt` when posing per frame
|
|
13681
|
-
- `holding`: `mug` (left or right), `phone` (left or right), `book` (one hand or both), `bag` (left or right), `briefcase` (left or right), `umbrella` (left or right), `broom` (left or right), `parcel` (both); pose fields `held.left`, `held.right`, `held.both` (below 0.5 lets go); `handGrip(joints, side)`
|
|
13682
|
-
- `meetHands(kind, a, b)` (stand them `meetingSpacing(kind, a, b)` apart): `handshake`, `highFive`, `fistBump`, `handOver`
|
|
14056
|
+
- `holding`: `mug` (left or right), `phone` (left or right), `book` (one hand or both), `bag` (left or right), `briefcase` (left or right), `umbrella` (left or right), `broom` (left or right), `cane` (left or right), `parcel` (both); pose fields `held.left`, `held.right`, `held.both` (below 0.5 lets go); `handGrip(joints, side)`
|
|
14057
|
+
- `meetHands(kind, a, b)` (stand them `meetingSpacing(kind, a, b)` apart): `handshake`, `highFive`, `fistBump`, `handOver`; `embrace(a, b)` (a hug, `embraceSpacing` apart); `helpUp(helper, sitter, progress)` (0 on the floor, hand taken; 1 standing; `helpUpSpacing` apart)
|
|
14058
|
+
- Everyday cycles like a gait: `humanCyclePose('sweeping' | 'brushing', phase, base)` (0 → 1 is one stroke and back; sweeping with `holding: { right: 'broom' }`)
|
|
13683
14059
|
|
|
13684
14060
|
## Code panel
|
|
13685
14061
|
|