{
  "schemaVersion": 1,
  "id": "coin-stack",
  "version": "1.0.0",
  "status": "published",
  "kind": "object",
  "title": "Coin Stack",
  "summary": "Shiny coins drop onto a growing tower, which leans, topples and scatters before the stack starts again. Loops perfectly.",
  "description": "Gold, silver or copper coins drop one after another onto a tower, each landing with a little bounce and wobble; when the stack is tall it leans about its foot and topples, the coins tumbling away across the floor in arcs, and then they sink away and the stack begins again. Choose the number of coins, the metal (gold, silver, copper or a mix), how crooked the stack is, the seed, the backdrop and whether the camera drifts.",
  "role": "Object (3D, three.js): a satisfying finance, savings and game object for money, growth and risk content.",
  "collections": [
    "satisfying",
    "bouncing-falling",
    "hypnotic-loops"
  ],
  "tags": [
    "coins",
    "stack",
    "tower",
    "topple",
    "money",
    "gold",
    "finance",
    "savings",
    "satisfying",
    "loop",
    "3d"
  ],
  "synonyms": [
    "coin tower",
    "money stack",
    "falling coins",
    "coin drop",
    "savings animation",
    "stacking coins"
  ],
  "useCases": [
    "A finance, savings or investment title scene",
    "A game or reward-building animation",
    "A growth-then-collapse metaphor"
  ],
  "featured": null,
  "publishedAt": "2026-10-06",
  "implementation": {
    "target": "three",
    "runtime": "browser",
    "language": "javascript",
    "module": "esm",
    "entry": "src/coin-stack.js",
    "exports": [
      {
        "name": "createCoinStack",
        "signature": "createCoinStack({ coins?, metal?, wobble?, seed? }) => { group, setProgress(progress), dispose() }",
        "description": "The coins as one instanced mesh (1.4 across, 0.14 thick) standing on y = 0; add it with an environment map and a shadow-casting light."
      },
      {
        "name": "METALS",
        "signature": "METALS: { gold, silver, copper, mixed }",
        "description": "Coin metals."
      }
    ],
    "reusable": [
      "src/coin-stack.js"
    ],
    "demo": "demo.js",
    "harness": "index.html"
  },
  "dependencies": [
    {
      "id": "three",
      "version": "0.185.1",
      "reason": "Renderer, geometry and shader materials."
    },
    {
      "id": "chrome-material",
      "version": "1.1.0",
      "scope": "demo",
      "reason": "Studio environment light, backdrop and contact shadow."
    },
    {
      "id": "apw-runtime",
      "version": "1.0.0",
      "scope": "demo",
      "reason": "Demo harness."
    }
  ],
  "params": [
    {
      "key": "coins",
      "label": "Coins",
      "type": "integer",
      "min": 12,
      "max": 60,
      "step": 1,
      "default": 36
    },
    {
      "key": "metal",
      "label": "Metal",
      "type": "select",
      "default": "gold",
      "options": [
        {
          "value": "gold",
          "label": "Gold"
        },
        {
          "value": "silver",
          "label": "Silver"
        },
        {
          "value": "copper",
          "label": "Copper"
        },
        {
          "value": "mixed",
          "label": "Mixed"
        }
      ]
    },
    {
      "key": "wobble",
      "label": "Crookedness",
      "type": "number",
      "min": 0,
      "max": 2,
      "step": 0.05,
      "default": 1
    },
    {
      "key": "seed",
      "label": "Seed",
      "type": "integer",
      "min": 1,
      "max": 999,
      "step": 1,
      "default": 3
    },
    {
      "key": "background",
      "label": "Backdrop",
      "type": "color",
      "default": "#1c2a3a"
    },
    {
      "key": "orbit",
      "label": "Camera drift",
      "type": "boolean",
      "default": true
    }
  ],
  "presets": [
    {
      "id": "default",
      "label": "Gold, thirty-six coins",
      "params": {}
    },
    {
      "id": "mixed",
      "label": "Mixed metals, tall",
      "params": {
        "metal": "mixed",
        "coins": 52,
        "background": "#241c2c"
      }
    },
    {
      "id": "silver",
      "label": "Silver, tidy stack",
      "params": {
        "metal": "silver",
        "wobble": 0.3,
        "coins": 24,
        "background": "#14202c"
      }
    },
    {
      "id": "copper",
      "label": "Copper, crooked",
      "params": {
        "metal": "copper",
        "wobble": 1.8,
        "seed": 9,
        "background": "#201812"
      }
    }
  ],
  "output": {
    "width": 1080,
    "height": 1080,
    "fps": 30,
    "durationSeconds": 12,
    "posterSeconds": 6,
    "alpha": false,
    "motion": "procedural",
    "loop": {
      "seamless": true,
      "cycleSeconds": 12,
      "method": "Coins drop at fixed shares of the loop, the tower topples and the coins sink away before it ends, and every coin's place is a closed form of the loop's phase, so the first frame (an empty floor) is the last."
    },
    "seed": {
      "param": "seed",
      "behavior": "Seed sets each coin's offset, turn, fall direction and roll: same seed, same tumble."
    }
  },
  "composition": {
    "inputs": "Time within the loop; the coins, metal, crookedness, seed, backdrop and camera drift.",
    "outputs": "A full frame rendered in 3D with soft shadows and a studio environment.",
    "coordinates": "The stack stands at the origin on y = 0; each coin is 1.4 across and 0.14 thick; the tower leans towards +x.",
    "lighting": "A warm key light with a shadow map and the studio environment on the embossed metal.",
    "timing": "setProgress(progress) places every coin in closed form; frames render in any order.",
    "compatibleWith": [
      "chrome-material",
      "orbit-camera",
      "kinetic-title",
      "number-reveal"
    ],
    "notes": [
      "The loop in shares: coins drop from 2 % to about 64 %, the tower stands, leans and topples from 74 % to 90 %, and the coins sink away by 99.5 %."
    ]
  },
  "reuse": [
    "Savings or finance title: Gold, thirty-six coins.",
    "Growth-and-risk metaphor: Mixed metals, tall.",
    "Calm money loop: Silver, tidy stack."
  ],
  "integration": {
    "newProject": "Create a WebGLRenderer with shadows and a studio environment (see chrome-material), add createCoinStack().group and call stack.setProgress(progress) each frame.",
    "existingProject": "Copy src/coin-stack.js; add stack.group to your scene with an environment map and a shadow-casting light."
  },
  "performance": {
    "notes": "One instanced mesh of up to 60 coins with a bump map and one shadow map. A few milliseconds a frame on an integrated Intel GPU.",
    "limits": "Software WebGL renders in about a second a frame."
  },
  "limitations": [
    "The fall is a formula, not rigid-body physics: coins do not collide with each other or the floor, and may pass through one another as they tumble.",
    "The coin face is a simple star and ring, not a portrait."
  ],
  "license": {
    "spdx": "MIT",
    "notice": "Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.",
    "thirdParty": []
  },
  "provenance": "Adapted from the owner's threejs-sketches/objects-scenes/coin-stack (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original object: closed-form drops with damped bounce, a lean-and-topple with ballistic tumbles, an embossed bump-mapped coin and an exact loop.",
  "changelog": [
    {
      "version": "1.0.0",
      "date": "2026-10-05",
      "notes": "Initial release."
    }
  ]
}
