@fleox/agent3d 0.2.2 → 0.3.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 +21 -13
- package/changelog.json +24 -0
- package/dist/agent/agent3d.mjs +228 -53
- package/dist/agent/chunks/{assets-BUUM9TUB.mjs → assets-YBkgdfgy.mjs} +27 -8
- package/dist/agent/chunks/{browser-Br1tURgt.mjs → browser-Dil7VM5m.mjs} +1 -1
- package/dist/agent/chunks/{cdp-Bdtm4fBN.mjs → cdp-DLEis_Z3.mjs} +1 -1
- package/dist/agent/chunks/{check-CfZcfaPs.mjs → check-DP9fRYbK.mjs} +64 -4
- package/dist/agent/chunks/depth-0bZsQn6N.mjs +190 -0
- package/dist/agent/chunks/depth-Dih8jLqx.mjs +483 -0
- package/dist/agent/chunks/{export-BHugc2H7.mjs → export-Cdqt3mt_.mjs} +8 -4
- package/dist/agent/chunks/{imageCodec-QM0EXQDJ.mjs → imageCodec-DeGfmBp3.mjs} +3 -3
- package/dist/agent/chunks/{objects-DBAws7uf.mjs → objects-DuytRxiC.mjs} +3 -3
- package/dist/agent/chunks/{optimizeSizing-CkZ3fZRp.mjs → optimizeSizing-B-BBiUkD.mjs} +51 -3
- package/dist/agent/chunks/{package-Dkr2v4or.mjs → package-d5e08XSG.mjs} +2 -1
- package/dist/agent/chunks/{render-EHb40avl.mjs → render-B05DU4Q5.mjs} +4 -4
- package/dist/agent/chunks/{scene-BgajNvBf.mjs → scene-DWgXH6As.mjs} +2 -2
- package/dist/agent/chunks/{server-CACCerkZ.mjs → server-Dt_YFvN7.mjs} +6 -2
- package/dist/agent/chunks/{tools-DKxgjQSJ.mjs → tools-Cv6N_YBI.mjs} +60 -6
- package/dist/agent/chunks/{tree-BrNYGui2.mjs → tree-CqSj-o8T.mjs} +1 -0
- package/dist/agent/ort/LICENSE.txt +9 -0
- package/dist/agent/ort/ort-wasm-simd-threaded.wasm +0 -0
- package/dist/agent/ort/ort.wasm.bundle.min.mjs +9 -0
- package/dist/runtime/agent3d-runtime.js +6 -6
- package/dist/runtime/agent3d-runtime.single.js +311 -62
- package/dist/runtime/chunks/assets-qnxDnVkj.js +1 -0
- package/dist/runtime/chunks/materials-dC4vDNHh.js +107 -0
- package/dist/runtime/chunks/{model-DbfZaLni.js → model-BCAl_NRl.js} +1 -1
- package/dist/runtime/chunks/photo-BlDYgYFM.js +250 -0
- package/dist/runtime/chunks/svg-CLUxY6Zy.js +1 -0
- package/dist/runtime/chunks/{text-BaON-ISS.js → text-rSo_2Luk.js} +2 -2
- package/dist/studio/assets/assets-BFJsr9Oo.js +1 -0
- package/dist/studio/assets/{camera-braC-Y4j.js → camera-DT0xHipx.js} +1 -1
- package/dist/studio/assets/{editor-DwKj0yf_.js → editor-BjgHj9g8.js} +1 -1
- package/dist/studio/assets/{game-Bd0sO8CA.js → game-BXZEc9HN.js} +3 -3
- package/dist/studio/assets/{generators-CFiebqmG.js → generators-DqkPMEzm.js} +1 -1
- package/dist/studio/assets/index-DVTzVcBD.js +479 -0
- package/dist/studio/assets/{model-Bg7e4Z-9.js → model-BqQW4Dg-.js} +1 -1
- package/dist/studio/assets/params-gVpEEiSK.js +1 -0
- package/dist/studio/assets/photo-DRoVO5iZ.js +250 -0
- package/dist/studio/assets/{physicsHost-CwJdYJ2g.js → physicsHost-DNdZ7AsT.js} +1 -1
- package/dist/studio/assets/{postfx-CGkvYb03.js → postfx-JFUGdY0d.js} +1 -1
- package/dist/studio/assets/runtime-CMAP4azF.js +572 -0
- package/dist/studio/assets/{shaders-Brwuj1zc.js → shaders-C7u6rN_6.js} +12 -12
- package/dist/studio/assets/svg-DkIOJjzS.js +2 -0
- package/dist/studio/assets/{text-DqnNIq0M.js → text-LISSAism.js} +2 -2
- package/dist/studio/index.html +1 -1
- package/package.json +2 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agent3d-assets/SKILL.md +40 -25
- package/plugin/skills/agent3d-create/SKILL.md +56 -21
- package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
- package/plugin/skills/agent3d-create/references/recipes.md +71 -6
- package/plugin/skills/agent3d-edit/SKILL.md +22 -22
- package/plugin/skills/agent3d-edit/references/patch-ops.md +11 -3
- package/plugin/skills/agent3d-game/SKILL.md +7 -7
- package/plugin/skills/agent3d-publish/SKILL.md +23 -21
- package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
- package/templates/hero-photo-3d/README.md +28 -0
- package/templates/hero-photo-3d/agent3d.json +8 -0
- package/templates/hero-photo-3d/assets/depth/street-depth.png +0 -0
- package/templates/hero-photo-3d/assets/manifest.json +25 -0
- package/templates/hero-photo-3d/assets/textures/street.jpg +0 -0
- package/templates/hero-photo-3d/preview.png +0 -0
- package/templates/hero-photo-3d/scene.json +120 -0
- package/templates/hero-photo-3d/template.json +8 -0
- package/dist/runtime/chunks/materials-w3EW0g-7.js +0 -107
- package/dist/runtime/chunks/svg-CfPIQnDG.js +0 -1
- package/dist/studio/assets/index-C87jPees.js +0 -479
- package/dist/studio/assets/runtime-DNb5FyOS.js +0 -572
- package/dist/studio/assets/svg-Db96jdHi.js +0 -2
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Each scene below passed `scene validate` (no errors, no warnings) and `check --render`, and was rendered and looked at (the README images in `docs/images/recipe-*.jpg` come from them). Start from the closest one, then change the brand parts (text, colours, model, URLs) with `scene patch` and render again:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx -y @fleox/agent3d@0.
|
|
7
|
-
npx -y @fleox/agent3d@0.
|
|
8
|
-
npx -y @fleox/agent3d@0.
|
|
9
|
-
npx -y @fleox/agent3d@0.
|
|
10
|
-
npx -y @fleox/agent3d@0.
|
|
6
|
+
npx -y @fleox/agent3d@0.3.0 new my-scene --target hero --json
|
|
7
|
+
npx -y @fleox/agent3d@0.3.0 scene validate --project my-scene --file recipe.json --json
|
|
8
|
+
npx -y @fleox/agent3d@0.3.0 scene apply --project my-scene --file recipe.json --yes --json
|
|
9
|
+
npx -y @fleox/agent3d@0.3.0 check --render --project my-scene --json
|
|
10
|
+
npx -y @fleox/agent3d@0.3.0 render --project my-scene --sheet --count 4 --json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Exact parameters of every rig, look, material, shader, generator and behaviour: `npx -y @fleox/agent3d@0.
|
|
13
|
+
Exact parameters of every rig, look, material, shader, generator and behaviour: `npx -y @fleox/agent3d@0.3.0 catalog <section> [id] --json`. Premium starting points per target kind: [art-direction.md](art-direction.md#premium-defaults).
|
|
14
14
|
|
|
15
15
|
## Product shot (1:1): softbox packshot
|
|
16
16
|
|
|
@@ -1355,3 +1355,68 @@ The built-in procedural character waving on a pedestal, eyes following the point
|
|
|
1355
1355
|
- `mattePastel` lightens its colour a lot: pick a saturated `color` for it.
|
|
1356
1356
|
- Animations: idle, walk, run, wave, jump, dance; styles: humanoid, robot, blob, cat, bird (`catalog generators character`).
|
|
1357
1357
|
- A rigged library model instead: `{ "kind": "model", "src": "library:models/characters/robot.glb", "fit": 2, "animation": { "clip": "Wave", "loop": true } }` (the model's description lists its clips; an unknown clip makes `render` report an `asset-load` issue listing the real ones).
|
|
1358
|
+
|
|
1359
|
+
## 3D photo hero (16:9): a photo that moves in depth
|
|
1360
|
+
|
|
1361
|
+
One photograph plus its estimated depth map: the street opens up in depth as the pointer (or the phone's gyroscope, or a slow automatic sway) moves the view; a white serif headline rises into the sky between the roofs. Built from a 3:2 blue-hour street photo (the `hero-photo-3d` template ships it): add the photo with `assets add`, run `assets depth assets/textures/photo.jpg`, then apply the scene.
|
|
1362
|
+
|
|
1363
|
+
```json
|
|
1364
|
+
{
|
|
1365
|
+
"version": 1,
|
|
1366
|
+
"id": "photo-hero",
|
|
1367
|
+
"title": "3D photo hero",
|
|
1368
|
+
"ariaLabel": "Old Town: a blue-hour street of painted houses and lit arcades, gently moving in 3D, with the headline Old Town, after-dark walking tours",
|
|
1369
|
+
"target": {"kind": "hero", "aspect": "16:9", "posterTime": 2.5, "reducedMotion": "static", "toneMapping": "none"},
|
|
1370
|
+
"camera": {"type": "perspective", "fov": 35, "position": [0, 0, 10], "target": [0, 0, 0]},
|
|
1371
|
+
"environment": {"background": "#0b1020"},
|
|
1372
|
+
"lights": [{"id": "fill", "type": "hemisphere", "intensity": 1}],
|
|
1373
|
+
"objects": [
|
|
1374
|
+
{
|
|
1375
|
+
"id": "photo",
|
|
1376
|
+
"kind": "photo",
|
|
1377
|
+
"src": "assets/textures/photo.jpg",
|
|
1378
|
+
"depth": "assets/depth/photo-depth.png",
|
|
1379
|
+
"mode": "parallax",
|
|
1380
|
+
"width": 11.9,
|
|
1381
|
+
"strength": 0.8,
|
|
1382
|
+
"focus": 0.45,
|
|
1383
|
+
"motion": {"pointer": 1, "gyro": true, "auto": "sway", "speed": 1.2, "smoothing": 0.9}
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"id": "title",
|
|
1387
|
+
"kind": "text",
|
|
1388
|
+
"text": "{data.title|OLD TOWN}",
|
|
1389
|
+
"font": "serif-bold",
|
|
1390
|
+
"size": 0.56,
|
|
1391
|
+
"depth": 0,
|
|
1392
|
+
"letterSpacing": 0.06,
|
|
1393
|
+
"align": "center",
|
|
1394
|
+
"position": [-0.35, 2.05, 0.5],
|
|
1395
|
+
"material": {"type": "basic", "color": "#ffffff"},
|
|
1396
|
+
"reveal": {"effect": "rise", "stagger": 0.04, "duration": 1, "delay": 0.3, "ease": "outCubic"}
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
"id": "subtitle",
|
|
1400
|
+
"kind": "text",
|
|
1401
|
+
"text": "{data.subtitle|AFTER-DARK WALKING TOURS}",
|
|
1402
|
+
"font": "sans-bold",
|
|
1403
|
+
"size": 0.088,
|
|
1404
|
+
"depth": 0,
|
|
1405
|
+
"letterSpacing": 0.1,
|
|
1406
|
+
"align": "center",
|
|
1407
|
+
"position": [-0.35, 1.69, 0.5],
|
|
1408
|
+
"material": {"type": "basic", "color": "#e8eef8"},
|
|
1409
|
+
"behaviours": [{"type": "appear", "effect": "fade", "duration": 1, "delay": 1.1}]
|
|
1410
|
+
}
|
|
1411
|
+
],
|
|
1412
|
+
"postfx": [{"type": "vignette", "darkness": 0.55}],
|
|
1413
|
+
"data": {"title": "OLD TOWN", "subtitle": "AFTER-DARK WALKING TOURS"}
|
|
1414
|
+
}
|
|
1415
|
+
```
|
|
1416
|
+
|
|
1417
|
+
- **Cover the frame.** The camera stays still (the photo's shader does the motion). At fov 35 and distance 10 a 16:9 frame is about 11.2 × 6.3 units: `width: 11.9` covers it with a 3:2 photo (top and bottom cropped). A narrower photo leaves background bars; `check` reports the covering photo as a `clipped` info, which is expected here.
|
|
1418
|
+
- **Depth.** `strength` 0.8 gives the bold parallax of this hero (parallax mode holds up to ~0.9; mesh ~0.7, layers ~0.6); `focus` is the depth (0 far … 1 near) that stays still: put it on the subject (0.45 here: the middle of the street) so the subject stays put while the near walls and the far sky move in opposite directions.
|
|
1419
|
+
- **Text on photos.** Photos are unlit and never tone mapped; `target.toneMapping: "none"` keeps a `basic` white title pure white instead of ACES grey. Put the headline over a calm area (sky, a wall, a soft background) and check its contrast in the render; a light `vignette` frames without darkening the subject.
|
|
1420
|
+
- **Motion.** `auto: "sway"` plays in headless renders, videos and on touch screens, and fades out while the pointer drives the view; `gyro: true` follows the phone's tilt. Reduced motion: no drift, half the pointer amount, and the `static` still at `posterTime`.
|
|
1421
|
+
- **Modes.** `parallax` (default, 2 triangles) for heroes and banners with small motions; `mesh` (a displaced grid, `segments`) survives larger moves such as `auto: "orbit"`; `layers` cuts the photo into depth slices for a pop-up-book look.
|
|
1422
|
+
- Tested: `render --count 4 --sheet` (the sway shows the effect across frames), then `render --frames 0.5,1,1.5,2 --sheet --input '[{"t": 0.1, "pointer": [-1, 0]}, {"t": 0.9, "pointer": [1, 0]}, {"t": 1.4, "pointer": [0, 1]}, {"t": 1.9, "pointer": [0, -1]}]'`: the near walls slide against the far street between frames. `check --render` passes (photo 552 KB + depth map 185 KB + two fonts ≈ 1 MB of the 1.5 MB hero budget).
|
|
@@ -4,7 +4,7 @@ description: Change an existing Agent3D project - summarise the scene, then patc
|
|
|
4
4
|
license: PolyForm-Noncommercial-1.0.0
|
|
5
5
|
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.3.0"
|
|
8
8
|
repository: "https://github.com/fleox/agent3d"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -15,23 +15,23 @@ A project is a folder with `agent3d.json`, `scene.json` (the scene), `assets/` (
|
|
|
15
15
|
|
|
16
16
|
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
17
17
|
|
|
18
|
-
Every command is `npx -y @fleox/agent3d@0.
|
|
18
|
+
Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
19
19
|
|
|
20
20
|
## 1. Understand before changing
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx -y @fleox/agent3d@0.
|
|
24
|
-
npx -y @fleox/agent3d@0.
|
|
25
|
-
npx -y @fleox/agent3d@0.
|
|
23
|
+
npx -y @fleox/agent3d@0.3.0 info --project my-banner --json
|
|
24
|
+
npx -y @fleox/agent3d@0.3.0 scene summary --project my-banner --json
|
|
25
|
+
npx -y @fleox/agent3d@0.3.0 render --project my-banner --sheet --json
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
Look at the sheet (Read the `data.sheet` PNG, relative to the project folder `data.dir`), then tell the user in two or three sentences what the scene contains (target and aspect, the main objects, the motion) before proposing changes. Read details on demand:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npx -y @fleox/agent3d@0.
|
|
32
|
-
npx -y @fleox/agent3d@0.
|
|
33
|
-
npx -y @fleox/agent3d@0.
|
|
34
|
-
npx -y @fleox/agent3d@0.
|
|
31
|
+
npx -y @fleox/agent3d@0.3.0 object get title --project my-banner --json
|
|
32
|
+
npx -y @fleox/agent3d@0.3.0 scene get --path objects#title.material --project my-banner --json
|
|
33
|
+
npx -y @fleox/agent3d@0.3.0 timeline get --project my-banner --json
|
|
34
|
+
npx -y @fleox/agent3d@0.3.0 catalog behaviours float --json
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## 2. Patch
|
|
@@ -39,8 +39,8 @@ npx -y @fleox/agent3d@0.2.2 catalog behaviours float --json
|
|
|
39
39
|
Put the ops in a file (or pass them inline as one JSON argument) and apply:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx -y @fleox/agent3d@0.
|
|
43
|
-
npx -y @fleox/agent3d@0.
|
|
42
|
+
npx -y @fleox/agent3d@0.3.0 scene patch --project my-banner --file ops.json --dry-run --json
|
|
43
|
+
npx -y @fleox/agent3d@0.3.0 scene patch --project my-banner --file ops.json --json
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
| Op | Shape | Use |
|
|
@@ -63,11 +63,11 @@ npx -y @fleox/agent3d@0.2.2 scene patch --project my-banner --file ops.json --js
|
|
|
63
63
|
Shortcuts for one object (same validation, same plans):
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npx -y @fleox/agent3d@0.
|
|
67
|
-
npx -y @fleox/agent3d@0.
|
|
68
|
-
npx -y @fleox/agent3d@0.
|
|
69
|
-
npx -y @fleox/agent3d@0.
|
|
70
|
-
npx -y @fleox/agent3d@0.
|
|
66
|
+
npx -y @fleox/agent3d@0.3.0 object update title --set material.color="#ffd166" --set size=0.9 --project my-banner --json
|
|
67
|
+
npx -y @fleox/agent3d@0.3.0 object add --id ball --geometry sphere --set geometry.radius=0.4 --set 'position=[3,0,0]' --project my-banner --json
|
|
68
|
+
npx -y @fleox/agent3d@0.3.0 object move gem --parent props --project my-banner --json
|
|
69
|
+
npx -y @fleox/agent3d@0.3.0 object remove pill --project my-banner --json
|
|
70
|
+
npx -y @fleox/agent3d@0.3.0 object remove pill --yes --project my-banner --json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
`--set` takes dotted keys and JSON values (`--set 'position=[0,1,0]'`, `--set visible=false`). More recipes per task (materials, lights, camera, timeline, behaviours, post effects): [references/patch-ops.md](references/patch-ops.md).
|
|
@@ -80,10 +80,10 @@ npx -y @fleox/agent3d@0.2.2 object remove pill --yes --project my-banner --json
|
|
|
80
80
|
- property: `position`, `position.x`, `rotation.y` (degrees), `scale`, `visible`, `material.opacity` / `color` / `emissiveIntensity` / `roughness`…, `material.uniforms.<name>`; lights `intensity`, `color`; camera `position`, `target`, `fov`, `focus`; `environment.fog.density`, `environment.exposure`; `postfx.<type>.<param>` (an effect written in `postfx` or brought by a `look` preset, e.g. `postfx.bloom.strength` with `{ "type": "look", "preset": "product" }`); models `morph.<name>`, `animation.<clip>.weight`.
|
|
81
81
|
- **Keys** are `[time, value]` or `[time, value, ease]` (the ease shapes the segment ending at that key) sorted by time. Values: numbers, `[x, y, z]`, colours, booleans, or relative strings `"+=0.5"`, `"-=1"`, `"*=1.2"` (from the rest value). The track `ease` (default `linear`) is `step`, `in` / `out` / `inOut` + `Quad`, `Cubic`, `Quart`, `Quint`, `Sine`, `Expo`, `Circ`, `Back`, `Elastic`, `Bounce`, or `"cubicBezier(0.16, 1, 0.3, 1)"`, `"spring(170, 12)"`, `"steps(4)"`. Multi-target selectors take `stagger` (seconds between targets) and `staggerFrom` (`start`, `end`, `center`, `edges`, `random`). Colour keys blend in OKLCh (saturated midpoints); `"colorSpace": "rgb"|"oklab"|"hsl"` on the track changes it.
|
|
82
82
|
```bash
|
|
83
|
-
npx -y @fleox/agent3d@0.
|
|
84
|
-
npx -y @fleox/agent3d@0.
|
|
85
|
-
npx -y @fleox/agent3d@0.
|
|
86
|
-
npx -y @fleox/agent3d@0.
|
|
83
|
+
npx -y @fleox/agent3d@0.3.0 timeline set --duration 10 --loop true --trigger visible --project my-banner --json
|
|
84
|
+
npx -y @fleox/agent3d@0.3.0 timeline add-track --target logo.rotation.y --keys "[[0,0],[10,360]]" --project my-banner --json
|
|
85
|
+
npx -y @fleox/agent3d@0.3.0 timeline add-track --target gem.position.y --keys '[[0,"+=0"],[1,"+=0.6","outBack"],[2,"+=0","inOutSine"]]' --project my-banner --json
|
|
86
|
+
npx -y @fleox/agent3d@0.3.0 timeline remove-track --target logo.rotation.y --yes --project my-banner --json
|
|
87
87
|
```
|
|
88
88
|
- Loops: the last key equals the first. Triggers: `load`, `visible` (default), `hover`, `click`, `scroll` (time = scroll progress; tune with `timeline.scroll`), `manual` (only interactions move it).
|
|
89
89
|
- **Markers and segments** name moments and ranges (`markers: { "lifted": 2.6 }`, `segments: { "hover-in": [2, "lifted"] }`); `autoplay: "intro"` plays only that segment on the trigger. **Interactions** (`scene.interactions`) wire hover / click / scroll / key / marker events to actions: play or toggle a segment, tween a property (`set`), `openUrl` (click / key only), emit an event, play a model clip. Agents on MCP or `tools call` can use the `interactions_set` tool (`{ "add": [...] }` or `{ "interactions": [...] }`, `dryRun`).
|
|
@@ -104,14 +104,14 @@ npx -y @fleox/agent3d@0.2.2 object remove pill --yes --project my-banner --json
|
|
|
104
104
|
The embed keeps the scene's aspect ratio at every width. A 4:1 banner is only ~98 px tall on a 390 px phone:
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
npx -y @fleox/agent3d@0.
|
|
107
|
+
npx -y @fleox/agent3d@0.3.0 render --project my-banner --size 390x98 --scale 2 --frames 2 --json
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
If the title becomes unreadable: shorter text, bigger `size`, fewer props, or a separate mobile version (a copy of the project with `target.aspect` "4:3" or `target.height`, exported under another `--name`, switched with CSS media queries on the page).
|
|
111
111
|
|
|
112
112
|
## 6. Finish
|
|
113
113
|
|
|
114
|
-
`npx -y @fleox/agent3d@0.
|
|
114
|
+
`npx -y @fleox/agent3d@0.3.0 check --project my-banner --render --json` until no errors and no warnings, then re-export (`export --yes` overwrites the previous export folder; tell the user to re-upload `<name>/` and, after an Agent3D update, `agent3d-runtime/`). Skill `agent3d-publish` covers the site side.
|
|
115
115
|
|
|
116
116
|
## Rules
|
|
117
117
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Patch ops cookbook
|
|
2
2
|
|
|
3
|
-
Apply with `npx -y @fleox/agent3d@0.
|
|
3
|
+
Apply with `npx -y @fleox/agent3d@0.3.0 scene patch --project <dir> --file ops.json --json` (add `--dry-run` to preview, `--yes` when the plan removes something or replaces a whole collection such as `lights`, `postfx`, `objects`, `timeline.tracks` or `ui.elements`: `plan.replaces` lists them). Ops run in order on a copy; the result is validated; on any error nothing is written and the error names the failing op (`details.opIndex`).
|
|
4
4
|
|
|
5
5
|
## Paths
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ An unknown id fails with `invalid` and the hint lists how to find ids (`object l
|
|
|
32
32
|
]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Object kinds: `mesh` (geometry + material), `text`, `model` (`src` = `assets/…` or `library:<id>`, `fit`, `animation`), `group`, `generator` (`generator` + `params` + `seed`), `particles` (`preset` + overrides), `instances` (one geometry many times: `layout` grid / scatter / circle / list), `svg` (inline markup or a project path, extruded). Common fields: `position`, `rotation` (degrees), `scale` (number or [x, y, z]), `visible`, `castShadow`, `receiveShadow`, `behaviours`, `children`, `tags`, `body` (physics), `href` (click opens a URL, pointer cursor), `userData`, `attach: "camera"` (top-level objects: rides with the camera; `position` / `rotation` are then in camera space, x right, y up, -z forward — `[0, -1.2, -6]` = 6 units in front of the lens — for captions and chapter labels that stay on screen during shots and scroll stories).
|
|
35
|
+
Object kinds: `mesh` (geometry + material), `text`, `model` (`src` = `assets/…` or `library:<id>`, `fit`, `animation`), `group`, `generator` (`generator` + `params` + `seed`), `particles` (`preset` + overrides), `instances` (one geometry many times: `layout` grid / scatter / circle / list), `svg` (inline markup or a project path, extruded), `photo` (a 3D photo: `src` image + `depth` map, `mode` parallax / mesh / layers, `width`, `strength`, `focus`, `motion` — see below). Common fields: `position`, `rotation` (degrees), `scale` (number or [x, y, z]), `visible`, `castShadow`, `receiveShadow`, `behaviours`, `children`, `tags`, `body` (physics), `href` (click opens a URL, pointer cursor), `userData`, `attach: "camera"` (top-level objects: rides with the camera; `position` / `rotation` are then in camera space, x right, y up, -z forward — `[0, -1.2, -6]` = 6 units in front of the lens — for captions and chapter labels that stay on screen during shots and scroll stories).
|
|
36
36
|
|
|
37
37
|
Duplicating a prop: `object get <id>`, change its `id` and `position`, `addObject`. Many copies: one `instances` object instead (cheaper):
|
|
38
38
|
|
|
@@ -40,6 +40,14 @@ Duplicating a prop: `object get <id>`, change its `id` and `position`, `addObjec
|
|
|
40
40
|
{ "op": "addObject", "object": { "id": "coins", "kind": "instances", "geometry": { "type": "cylinder", "radiusTop": 0.3, "radiusBottom": 0.3, "height": 0.08 }, "material": { "preset": "gold" }, "layout": { "type": "circle", "count": 12, "radius": 4 } } }
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
A 3D photo (the depth map comes from `assets depth <image>`, skill `agent3d-assets`; workflow and tips: skill `agent3d-create`, "Bring a photo to life"):
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{ "op": "addObject", "object": { "id": "photo", "kind": "photo", "src": "assets/textures/photo.jpg", "depth": "assets/depth/photo-depth.png", "mode": "parallax", "width": 11.9, "strength": 0.3, "focus": 0.5, "motion": { "pointer": 1, "gyro": true, "auto": "sway", "speed": 1 } } }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Fields: `mode` (`parallax` default, `mesh`, `layers`), `width` / `height` (world units; the height follows the image aspect), `strength` (0..1, default 0.5), `focus` (the depth that stays still, 0 far … 1 near), `segments` (mesh), `layers` (layers), `edgeCut` (mesh / layers: hide stretched edges, default 0.08), `motion` (`pointer`, `scroll`, `gyro`, `auto`: `sway` / `orbit` / `zoom` / `none`, `speed`, `smoothing`), `material` (only `opacity`, `color` tint, `emissiveIntensity`). Photos are unlit and not tone mapped. Without `depth` the photo is flat (`validate` warns).
|
|
50
|
+
|
|
43
51
|
## Text and letters
|
|
44
52
|
|
|
45
53
|
```json
|
|
@@ -236,7 +244,7 @@ These play the segments of the markers block above (a segment must exist before
|
|
|
236
244
|
- Segments named in `play` / `toggle` must exist in `timeline.segments` (validation says so). Targets get a pointer cursor.
|
|
237
245
|
- Without patches (MCP or the CLI tool runner): `interactions_set` appends with `add` or replaces with `interactions`:
|
|
238
246
|
```bash
|
|
239
|
-
npx -y @fleox/agent3d@0.
|
|
247
|
+
npx -y @fleox/agent3d@0.3.0 tools call interactions_set --input '{"add": [{"on": "click", "target": "blob", "do": [{"toggle": "hover-in"}]}], "dryRun": true}' --project my-hero --json
|
|
240
248
|
```
|
|
241
249
|
- Check hover states headless: `render --input '[{"t": 1.9, "pointer": [0, -0.3]}]' --frames 2,3`.
|
|
242
250
|
|
|
@@ -4,7 +4,7 @@ description: Build a mini game or an interactive 3D experience for a web page wi
|
|
|
4
4
|
license: PolyForm-Noncommercial-1.0.0
|
|
5
5
|
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.3.0"
|
|
8
8
|
repository: "https://github.com/fleox/agent3d"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -15,13 +15,13 @@ A game is an ordinary scene (`target.kind: "game"`) plus **scripts**: ES modules
|
|
|
15
15
|
|
|
16
16
|
**Language:** talk to the user in their language; keep commands, ids, code and files in English.
|
|
17
17
|
|
|
18
|
-
Every command is `npx -y @fleox/agent3d@0.
|
|
18
|
+
Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
19
19
|
|
|
20
20
|
## Start
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx -y @fleox/agent3d@0.
|
|
24
|
-
npx -y @fleox/agent3d@0.
|
|
23
|
+
npx -y @fleox/agent3d@0.3.0 new dodge --target game --title "Dodge" --json
|
|
24
|
+
npx -y @fleox/agent3d@0.3.0 scene summary --project dodge --json
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
The game starter has a `kinematic` player moved by position, coins with a `coin` tag, a follow camera, a score HUD, a coin sound and `scripts/game.js` (move with arrows / WASD, collect coins). Game templates to start from (`templates list --json`): `game-coin-collector`, `game-runner`, `game-maze`, `game-tap-targets`, `game-physics-playground` (rigid bodies, impulses, impact sounds) — `new my-game --template game-physics-playground --json`. A complete validated example (lane runner: lanes, spawning by cloning, difficulty ramp, best score, attract mode) is in skill `agent3d-create` → `references/recipes.md` ("Lane runner game"; "Physics toss game" for rigid bodies); patterns in [references/game-patterns.md](references/game-patterns.md); the full API in [references/script-api.md](references/script-api.md).
|
|
@@ -55,15 +55,15 @@ Scripts only get `api`. `check` fails (`forbidden-script`) on `fetch`, `XMLHttpR
|
|
|
55
55
|
1. Design the loop with the user in one paragraph: goal, controls (keyboard + touch), how you lose, what the score counts, how long a round lasts (30–90 s for a web page).
|
|
56
56
|
2. Declare the scene: player and obstacle templates (hidden, with `tags` and a `body`), camera, HUD elements per phase, sounds (`catalog sounds`), `data` for tuning.
|
|
57
57
|
3. Write the script (patterns below). Keep it under ~200 lines; one file is fine.
|
|
58
|
-
4. Validate and lint: `npx -y @fleox/agent3d@0.
|
|
58
|
+
4. Validate and lint: `npx -y @fleox/agent3d@0.3.0 check --project dodge --json` (sandbox errors carry the line: `scripts/game.js:12`).
|
|
59
59
|
5. Render several moments and LOOK:
|
|
60
60
|
```bash
|
|
61
|
-
npx -y @fleox/agent3d@0.
|
|
61
|
+
npx -y @fleox/agent3d@0.3.0 render --project dodge --sheet --frames 0,2,4,6 --json
|
|
62
62
|
```
|
|
63
63
|
Plain renders have no player input, so the game must show something on its own: an **attract mode** (an autopilot plays during the `ready` phase, behind the title and Play button). The HUD is captured because the scene has a `ui` (`--capture page` forces it); posters (`export --format poster`, the embed's `poster.webp`) and videos show the canvas only, without the HUD. Check `data.issues` and `data.consoleErrors` for `script-error`. `data.state` is the script's `api.state` after the last frame (e.g. `{ "score": 0, "phase": "ready" }`); frame and sheet paths are relative to the project folder `data.dir`.
|
|
64
64
|
6. **Play it headlessly** with `--input`: a JSON script of simulated keys / clicks applied while seeking (frames are rendered in time order), then check `data.state` and the frames:
|
|
65
65
|
```bash
|
|
66
|
-
npx -y @fleox/agent3d@0.
|
|
66
|
+
npx -y @fleox/agent3d@0.3.0 render --project dodge --sheet --frames 0,1,2,3 --input '[{"t": 0.2, "click": [0, -0.3]}, {"t": 0.5, "key": "ArrowLeft", "hold": 0.6}, {"t": 1.5, "key": "Space", "down": true}, {"t": 1.6, "key": "Space", "down": false}]' --json
|
|
67
67
|
```
|
|
68
68
|
Events: `{ "t", "key", "down" }` (`key` is a `KeyboardEvent.code`: `ArrowLeft`, `KeyA`, `Space`…; `down: false` releases), `{ "t", "key", "hold": seconds }` (press and release), `{ "t", "click": [x, y] }`, `{ "t", "pointer": [x, y] }` (add `"down": true` / `false` to press / release there), `{ "t", "pointerDown": [x, y] }` and `{ "t", "pointerUp": [x, y] }` (hold the pointer: `api.input.pointer.down`), `{ "t", "drag": { "from": [x, y], "to": [x, y], "duration": 0.4 } }` (press, move, release), `{ "t", "swipe": "left" | "right" | "up" | "down" }` (what `api.input.swipe()` returns next step), `{ "t", "scroll": 0.5 }` (page scroll progress, scroll-driven scenes), `{ "t", "ui": "retryBtn" }` (click that HUD button by id — a warning in `inputWarnings` when it is hidden at that time), `{ "t", "emit": "retry" }` (emit the event / button action directly), `{ "t", "segment": "intro" }` (play a timeline segment) — canvas coordinates −1..1, y up (a canvas `click` never presses a HUD button: use `ui`). Unknown fields are rejected (exit 2, the hint lists the valid shapes). Test the touch controls too, e.g. `--input '[{"t": 0.5, "swipe": "left"}, {"t": 1.2, "drag": {"from": [0, -0.5], "to": [0, 0.3], "duration": 0.3}}]'`. Use `@inputs.json` for longer scripts. MCP: `render_preview` takes the same events as `input`.
|
|
69
69
|
7. To test a state that is hard to reach with input (game over screen, high score), temporarily set the starting phase in `api.data` (e.g. `"startPhase": "over"`), render, then restore it.
|
|
@@ -4,7 +4,7 @@ description: Export an Agent3D scene and put it on a website - embed folder (Web
|
|
|
4
4
|
license: PolyForm-Noncommercial-1.0.0
|
|
5
5
|
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.3.0"
|
|
8
8
|
repository: "https://github.com/fleox/agent3d"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -13,12 +13,12 @@ allowed-tools: Bash Read Write
|
|
|
13
13
|
|
|
14
14
|
**Language:** talk to the user in their language; keep commands, code and files in English.
|
|
15
15
|
|
|
16
|
-
Every command is `npx -y @fleox/agent3d@0.
|
|
16
|
+
Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
17
17
|
|
|
18
18
|
## Before exporting
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npx -y @fleox/agent3d@0.
|
|
21
|
+
npx -y @fleox/agent3d@0.3.0 check --project my-banner --render --json
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
No errors, no warnings (or warnings the user accepted). Keep the `licences` list: credits ship in the export.
|
|
@@ -34,18 +34,20 @@ No errors, no warnings (or warnings the user accepted). Keep the `licences` list
|
|
|
34
34
|
| `video` | `export --format video --project my-banner` | `dist/video.webm` (VP9), or MP4 (H.264) when `--out` ends in `.mp4`; `--duration`, `--fps`, `--size`, `--quality` | Social posts, presentations, places that can't run WebGL |
|
|
35
35
|
| `gif` | `export --format gif --project my-banner` | `dist/animation.gif` (looping, 640 px wide, 15 fps by default) | Email, chat, READMEs |
|
|
36
36
|
|
|
37
|
+
Every asset the scene uses is copied into the export (never hotlinked): a 3D photo ships its photo and its depth PNG (`<name>/assets/textures/…`, `<name>/assets/depth/…`), never the depth model. `CREDITS.txt` lists the depth map with the photo's licence and author.
|
|
38
|
+
|
|
37
39
|
Default outputs land in `<project>/dist/`. A relative `--out` is resolved from the **project folder** (like every output path of `render` and `export`): `--project my-banner --out dist/promo.mp4` writes `my-banner/dist/promo.mp4`; absolute paths are kept.
|
|
38
40
|
|
|
39
41
|
```bash
|
|
40
|
-
npx -y @fleox/agent3d@0.
|
|
41
|
-
npx -y @fleox/agent3d@0.
|
|
42
|
-
npx -y @fleox/agent3d@0.
|
|
43
|
-
npx -y @fleox/agent3d@0.
|
|
44
|
-
npx -y @fleox/agent3d@0.
|
|
45
|
-
npx -y @fleox/agent3d@0.
|
|
46
|
-
npx -y @fleox/agent3d@0.
|
|
47
|
-
npx -y @fleox/agent3d@0.
|
|
48
|
-
npx -y @fleox/agent3d@0.
|
|
42
|
+
npx -y @fleox/agent3d@0.3.0 export --project my-banner --json
|
|
43
|
+
npx -y @fleox/agent3d@0.3.0 export --project my-banner --name spring-banner --out ./site/agent3d --json
|
|
44
|
+
npx -y @fleox/agent3d@0.3.0 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
|
|
45
|
+
npx -y @fleox/agent3d@0.3.0 export --project my-banner --optimize --json
|
|
46
|
+
npx -y @fleox/agent3d@0.3.0 export --format zip --project my-banner --json
|
|
47
|
+
npx -y @fleox/agent3d@0.3.0 export --format single-html --project my-banner --json
|
|
48
|
+
npx -y @fleox/agent3d@0.3.0 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
|
|
49
|
+
npx -y @fleox/agent3d@0.3.0 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
|
|
50
|
+
npx -y @fleox/agent3d@0.3.0 export --format gif --duration 4 --project my-banner --json
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
Embed / zip options:
|
|
@@ -68,11 +70,11 @@ Embed / zip options:
|
|
|
68
70
|
Media straight from `render` (frame-exact, any size / fps; LOOK at a few frames of the result):
|
|
69
71
|
|
|
70
72
|
```bash
|
|
71
|
-
npx -y @fleox/agent3d@0.
|
|
72
|
-
npx -y @fleox/agent3d@0.
|
|
73
|
-
npx -y @fleox/agent3d@0.
|
|
74
|
-
npx -y @fleox/agent3d@0.
|
|
75
|
-
npx -y @fleox/agent3d@0.
|
|
73
|
+
npx -y @fleox/agent3d@0.3.0 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
|
|
74
|
+
npx -y @fleox/agent3d@0.3.0 render --gif renders/banner.gif --duration 4 --project my-banner --json
|
|
75
|
+
npx -y @fleox/agent3d@0.3.0 render --webp renders/banner.webp --duration 4 --project my-banner --json
|
|
76
|
+
npx -y @fleox/agent3d@0.3.0 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
|
|
77
|
+
npx -y @fleox/agent3d@0.3.0 render --scroll 0.5 --project my-scroll-story --json
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
`--quality high|ultra` supersamples 2× / 3× (smoother edges), `--transparent` gives alpha PNG / GIF / WebP, `--scroll 0.5` holds a scroll-driven scene at that scroll progress, `--fps` / `--start` / `--bitrate` tune videos, `--yes` overwrites an existing media file. `--video`, `--gif` and `--webp` paths (like `--out`) are relative to the project folder. MP4 needs Google Chrome or Edge (H.264 encoder); with Chromium, render `.webm`. Videos and posters capture the WebGL canvas only (no HUD).
|
|
@@ -80,8 +82,8 @@ npx -y @fleox/agent3d@0.2.2 render --scroll 0.5 --project my-scroll-story --json
|
|
|
80
82
|
Scenes whose timeline waits for the visitor (`autoplay: false`, `trigger: "manual"` / `"click"`, segments played by interactions) are still at t = 0 in a plain render: film the segment with `--segment`, or play the interaction with `--input` (frames, `--video`, `--gif` and `--webp` all apply it):
|
|
81
83
|
|
|
82
84
|
```bash
|
|
83
|
-
npx -y @fleox/agent3d@0.
|
|
84
|
-
npx -y @fleox/agent3d@0.
|
|
85
|
+
npx -y @fleox/agent3d@0.3.0 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
|
|
86
|
+
npx -y @fleox/agent3d@0.3.0 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
`--reduced-motion` renders what visitors with prefers-reduced-motion see.
|
|
@@ -112,7 +114,7 @@ Always paste the snippet from the export result (hashes and file names change wi
|
|
|
112
114
|
Write `{data.key}` in a text object's `text` (or an `href`), give defaults in `scene.data`, and the page fills them per embed — no re-export:
|
|
113
115
|
|
|
114
116
|
```bash
|
|
115
|
-
npx -y @fleox/agent3d@0.
|
|
117
|
+
npx -y @fleox/agent3d@0.3.0 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
|
|
116
118
|
```
|
|
117
119
|
|
|
118
120
|
```html
|
|
@@ -125,7 +127,7 @@ Placeholders work in text objects' `text`, any object's `href` and HUD texts. `{
|
|
|
125
127
|
|
|
126
128
|
Step-by-step per platform (plain HTML, WordPress, AgentCMS, React / Next.js, Astro, Vue / Nuxt, Svelte, static hosts and CDNs): [references/integrations.md](references/integrations.md). In short:
|
|
127
129
|
|
|
128
|
-
- **Plain HTML / static hosts** (Netlify, GitHub Pages, Cloudflare Pages, S3): copy the export folder next to the page, paste the snippet. Open `index.html` of the export through a local server (`npx -y @fleox/agent3d@0.
|
|
130
|
+
- **Plain HTML / static hosts** (Netlify, GitHub Pages, Cloudflare Pages, S3): copy the export folder next to the page, paste the snippet. Open `index.html` of the export through a local server (`npx -y @fleox/agent3d@0.3.0 serve --project my-banner` previews the project; module scripts don't run from `file://`: opened that way, the demo page only shows the poster and a note asking for a web server).
|
|
129
131
|
- **WordPress**: export with `--base-url /wp-content/uploads/agent3d/`, upload the export folder there (SFTP / the host's file manager), then a **Custom HTML** block with the snippet. The media library refuses `.js` / `.json` files.
|
|
130
132
|
- **Webflow / Shopify**: host the folder on a static host or CDN, export with `--base-url https://…/`, paste the snippet in an Embed element / Custom Liquid section.
|
|
131
133
|
- **Squarespace / Wix / Framer**: `single-html` in an `<iframe>`.
|
|
@@ -7,7 +7,7 @@ All examples assume the embed export was uploaded to `/agent3d/` at the root of
|
|
|
7
7
|
/agent3d/spring-banner/scene.json (+ assets/, scripts/, poster.webp, og-image.png, CREDITS.txt)
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
Export straight into that layout with `npx -y @fleox/agent3d@0.
|
|
10
|
+
Export straight into that layout with `npx -y @fleox/agent3d@0.3.0 export --project spring-banner --out ./public/agent3d --base-url /agent3d/ --json` (the `<name>` folder defaults to the project name; `--name` changes it; `--base-url` writes root-absolute URLs in the snippet, the wrappers and EMBED.md). Paste the `snippet` of the result: the examples below shorten the integrity hashes and the poster markup.
|
|
11
11
|
|
|
12
12
|
## Plain HTML
|
|
13
13
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 3D photo hero
|
|
2
|
+
|
|
3
|
+
A 16:9 hero made from one photograph: a blue-hour street of Innsbruck's old town (CC0, Wilfredo Rafael Rodriguez Hernandez on Wikimedia Commons) turned into a **3D photo**. The `photo` object pairs the picture with a depth map estimated locally by `agent3d assets depth` (white = near, black = far): in `parallax` mode the shader shifts near and far parts of the image differently, so the street opens up in depth as the view moves.
|
|
4
|
+
|
|
5
|
+
What moves the view: the **pointer** over the scene, the **gyroscope** on phones, and a gentle automatic **sway** (a figure-eight drift that also plays in headless renders, videos and on touch screens; it fades out while the pointer drives the view). A serif headline and a spaced subtitle rise into the sky gap between the roofs. Visitors who prefer reduced motion get the still frame at 2.5 s.
|
|
6
|
+
|
|
7
|
+
## Use your own photo
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
agent3d assets add /path/to/photo.jpg --license CC0-1.0 --author "Name" --json
|
|
11
|
+
agent3d assets depth assets/textures/photo.jpg --json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then point `objects#photo.src` to `assets/textures/photo.jpg` and `objects#photo.depth` to `assets/depth/photo-depth.png`, render (`render --count 4 --sheet`) and move the headline to a calm area of the picture. The first `assets depth` run downloads the depth model once (27 MB, no account); later runs work offline.
|
|
15
|
+
|
|
16
|
+
## What to tweak
|
|
17
|
+
|
|
18
|
+
| Change | Where |
|
|
19
|
+
|---|---|
|
|
20
|
+
| Headline / subtitle | `data.title`, `data.subtitle` (or `data-title` / `data-subtitle` on the embed) |
|
|
21
|
+
| Headline position | `objects#title.position`, `objects#subtitle.position` (keep them over a quiet part of the photo) |
|
|
22
|
+
| Depth amount | `objects#photo.strength` (0.2-0.4 looks natural; higher stretches edges) |
|
|
23
|
+
| Still plane | `objects#photo.focus` (0 = far … 1 = near): the depth that does not move — set it to the subject's depth |
|
|
24
|
+
| Motion | `objects#photo.motion`: `pointer` amount, `gyro`, `auto` (`sway`, `orbit`, `zoom`, `none`), `speed` (cycles per 10 s), `smoothing` |
|
|
25
|
+
| Look | `objects#photo.mode`: `parallax` (default), `mesh` (survives larger camera moves), `layers` (pop-up book) |
|
|
26
|
+
| Photo size | `objects#photo.width` (11.9 covers the 16:9 frame; the photo is 3:2, so top and bottom are cropped) |
|
|
27
|
+
|
|
28
|
+
`target.toneMapping` is `none` so the white headline stays pure white (photos are always shown with their original colours). The photo (552 KB) and its depth map (185 KB) are the only assets; run `assets optimize` to lighten the photo for production.
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"assets": [
|
|
3
|
+
{
|
|
4
|
+
"path": "assets/depth/street-depth.png",
|
|
5
|
+
"kind": "texture",
|
|
6
|
+
"bytes": 185654,
|
|
7
|
+
"source": "depth-anything-v2-small",
|
|
8
|
+
"sourceUrl": "https://huggingface.co/onnx-community/depth-anything-v2-small",
|
|
9
|
+
"license": "CC0-1.0",
|
|
10
|
+
"author": "Wilfredo Rafael Rodriguez Hernandez (Wilfredor)",
|
|
11
|
+
"attribution": "Depth map of assets/textures/street.jpg estimated with Depth Anything V2 Small (Apache-2.0). Image: \"street.jpg\" by Wilfredo Rafael Rodriguez Hernandez (Wilfredor) (https://commons.wikimedia.org/wiki/File:Herzog-Friedrich-Stra%C3%9Fe_in_Innsbruck%27s_Historic_Old_Town,_Austria.jpg), licensed under CC0-1.0.",
|
|
12
|
+
"addedAt": "2026-11-26T00:00:00.000Z"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"path": "assets/textures/street.jpg",
|
|
16
|
+
"kind": "texture",
|
|
17
|
+
"bytes": 552060,
|
|
18
|
+
"source": "local",
|
|
19
|
+
"sourceUrl": "https://commons.wikimedia.org/wiki/File:Herzog-Friedrich-Stra%C3%9Fe_in_Innsbruck%27s_Historic_Old_Town,_Austria.jpg",
|
|
20
|
+
"license": "CC0-1.0",
|
|
21
|
+
"author": "Wilfredo Rafael Rodriguez Hernandez (Wilfredor)",
|
|
22
|
+
"addedAt": "2026-11-26T00:00:00.000Z"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"id": "hero-photo-3d",
|
|
4
|
+
"title": "3D photo hero",
|
|
5
|
+
"ariaLabel": "Old Town: a blue-hour street of painted houses and lit arcades in Innsbruck, gently moving in 3D, with the headline Old Town, after-dark walking tours",
|
|
6
|
+
"target": {
|
|
7
|
+
"kind": "hero",
|
|
8
|
+
"aspect": "16:9",
|
|
9
|
+
"posterTime": 2.5,
|
|
10
|
+
"reducedMotion": "static",
|
|
11
|
+
"toneMapping": "none"
|
|
12
|
+
},
|
|
13
|
+
"camera": {
|
|
14
|
+
"type": "perspective",
|
|
15
|
+
"fov": 35,
|
|
16
|
+
"position": [
|
|
17
|
+
0,
|
|
18
|
+
0,
|
|
19
|
+
10
|
|
20
|
+
],
|
|
21
|
+
"target": [
|
|
22
|
+
0,
|
|
23
|
+
0,
|
|
24
|
+
0
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"environment": {
|
|
28
|
+
"background": "#0b1020"
|
|
29
|
+
},
|
|
30
|
+
"lights": [
|
|
31
|
+
{
|
|
32
|
+
"id": "fill",
|
|
33
|
+
"type": "hemisphere",
|
|
34
|
+
"intensity": 1
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"objects": [
|
|
38
|
+
{
|
|
39
|
+
"id": "photo",
|
|
40
|
+
"kind": "photo",
|
|
41
|
+
"src": "assets/textures/street.jpg",
|
|
42
|
+
"depth": "assets/depth/street-depth.png",
|
|
43
|
+
"mode": "parallax",
|
|
44
|
+
"width": 11.9,
|
|
45
|
+
"strength": 0.8,
|
|
46
|
+
"focus": 0.45,
|
|
47
|
+
"motion": {
|
|
48
|
+
"pointer": 1,
|
|
49
|
+
"gyro": true,
|
|
50
|
+
"auto": "sway",
|
|
51
|
+
"speed": 1.2,
|
|
52
|
+
"smoothing": 0.9
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "title",
|
|
57
|
+
"kind": "text",
|
|
58
|
+
"text": "{data.title|OLD TOWN}",
|
|
59
|
+
"font": "serif-bold",
|
|
60
|
+
"size": 0.56,
|
|
61
|
+
"depth": 0,
|
|
62
|
+
"letterSpacing": 0.06,
|
|
63
|
+
"align": "center",
|
|
64
|
+
"position": [
|
|
65
|
+
-0.35,
|
|
66
|
+
2.05,
|
|
67
|
+
0.5
|
|
68
|
+
],
|
|
69
|
+
"material": {
|
|
70
|
+
"type": "basic",
|
|
71
|
+
"color": "#ffffff"
|
|
72
|
+
},
|
|
73
|
+
"reveal": {
|
|
74
|
+
"effect": "rise",
|
|
75
|
+
"stagger": 0.04,
|
|
76
|
+
"duration": 1,
|
|
77
|
+
"delay": 0.3,
|
|
78
|
+
"ease": "outCubic"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "subtitle",
|
|
83
|
+
"kind": "text",
|
|
84
|
+
"text": "{data.subtitle|AFTER-DARK WALKING TOURS}",
|
|
85
|
+
"font": "sans-bold",
|
|
86
|
+
"size": 0.088,
|
|
87
|
+
"depth": 0,
|
|
88
|
+
"letterSpacing": 0.1,
|
|
89
|
+
"align": "center",
|
|
90
|
+
"position": [
|
|
91
|
+
-0.35,
|
|
92
|
+
1.69,
|
|
93
|
+
0.5
|
|
94
|
+
],
|
|
95
|
+
"material": {
|
|
96
|
+
"type": "basic",
|
|
97
|
+
"color": "#e8eef8"
|
|
98
|
+
},
|
|
99
|
+
"behaviours": [
|
|
100
|
+
{
|
|
101
|
+
"type": "appear",
|
|
102
|
+
"effect": "fade",
|
|
103
|
+
"duration": 1,
|
|
104
|
+
"delay": 1.1
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"postfx": [
|
|
110
|
+
{
|
|
111
|
+
"type": "vignette",
|
|
112
|
+
"darkness": 0.55
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"description": "A blue-hour photo of a European old-town street turned into a 3D photo (image + estimated depth map) that moves with the pointer, the phone gyroscope and a gentle automatic sway, under a serif headline.",
|
|
116
|
+
"data": {
|
|
117
|
+
"title": "OLD TOWN",
|
|
118
|
+
"subtitle": "AFTER-DARK WALKING TOURS"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "hero-photo-3d",
|
|
3
|
+
"title": "3D photo hero",
|
|
4
|
+
"description": "A photo brought to life: a blue-hour old-town street (CC0) turned into a 3D photo with its estimated depth map, moving in depth with the pointer, the phone's gyroscope and a gentle automatic sway, under a white serif headline and subtitle (data-bound). Swap the photo and run `assets depth` to make it yours.",
|
|
5
|
+
"kind": "hero",
|
|
6
|
+
"tags": ["hero", "photo", "3d-photo", "depth-map", "parallax", "image", "travel", "city", "street", "night", "serif", "pointer", "gyro", "data-bindings"],
|
|
7
|
+
"aspect": "16:9"
|
|
8
|
+
}
|