# Gold Pocket Watch — `pocket-watch@1.0.0`

A polished gold pocket watch whose hands show any time, with a ticking, beating or sweeping second hand.

A pocket watch made entirely in code: a lathe-turned gold case with a domed glass crystal, an enamel dial with Roman numerals or applied batons, blued-steel Breguet hands, a knurled crown and a chain. Set the time it starts at and how fast time runs, from real time with a quartz tick to a time-lapse where the hands race round. Pick the case metal and the dial.

- Kind: object; status: published; digest sha256:3ba904ff66e7fa8b5d9c21d8b711291b14d43d9ef6d091719c9966c13f158abe
- Role: Hero object: a 3D pocket watch that shows a chosen time.
- Implementation: three; entry `src/pocket-watch.js`
- Files: https://aipixelwizard.com/registry/pocket-watch/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/pocket-watch.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/pocket-watch/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/pocket-watch/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Geometry, physical materials, transmission glass and shadows.; `chrome-material@1.1.0` (demo) — Demo uses the shared studio: environment light, cove, floor and contact shadow.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createPocketWatch({ finish?, dial?, numerals?, chain?, crystal?, anisotropy? }) => { group, setTime(seconds, { motion?, showSeconds? }), dispose() }` — The watch as a THREE.Group in watch units (case radius 1, dial facing +Y). setTime takes seconds since midnight.
- `handAngles(seconds, motion = 'tick') => { hour, minute, second }` — Clockwise hand angles in radians; motion is 'tick' (quartz step with settle), 'beat' (six steps a second) or 'sweep'.
- `watchSeconds(info, { start?, rate? }) => number` — Time shown at a frame: start + elapsed video time × rate (1 real time, 60 a minute per second, 3600 an hour per second).
- `drawDial({ dial?, numerals?, size?, dialRadius? }) => HTMLCanvasElement` — The dial artwork on a canvas (Roman numerals are drawn as strokes, so no font is needed).

## Parameters
- `finish` (select one of gold | rose | silver | black, default "gold") — Case metal
- `dial` (select one of cream | white | black | blue, default "cream") — Dial
- `numerals` (select one of roman | batons, default "roman") — Hour markers
- `hour` (integer 1–12, default 10) — Start hour
- `minute` (integer 0–59, default 8) — Start minute
- `second` (integer 0–59, default 36) — Start second
- `motion` (select one of tick | beat | sweep, default "tick") — Second hand: How the second hand moves in real time.
- `speed` (select one of real | minutes | hours, default "real") — Time speed: Fast speeds turn the clip into a time-lapse.
- `chain` (boolean, default true) — Chain
- `crystal` (boolean, default true) — Glass crystal: The domed glass over the dial. It adds reflections; turn it off for the clearest dial.
- `surface` (color, default "#3a0c18") — Velvet colour

## Composition
- Inputs: Seconds since midnight for setTime (watchSeconds turns frame info into it). Needs scene.environment for the metal.
- Outputs: A THREE.Group: case, dial, hands, crystal, crown, bow and an optional chain lying on the floor.
- Coordinates: Watch units: case radius 1, dial facing +Y, 12 o'clock toward -Z. The back rests on y = -0.16 and the chain lies at that level, so lift the group by 0.16 × its scale to stand it on a floor.
- Lighting: Image-based (scene.environment) for the metal; add a shadow-casting directional light for hand shadows on the dial.
- Timing: setTime(seconds) is a pure function of the time shown; frames render in any order.
- Works with: chrome-material, orbit-camera, rolling-counter, kinetic-title, armillary-sphere
- Stand it upright by rotating the group -90° about X (dial toward +Z) and pass chain: false.
- The crystal uses transmission, which refracts only opaque objects behind it (the dial and hands are opaque).
- The demo lays it on a velvet tray (a sheen material) with a shadow-casting key light; that tray is part of demo.js, not the reusable file.

## Output and loop
- 1080×1080, 30 fps, 8 s, procedural
- Seamless loop: no — Not a loop: the hands show time passing. The camera sway is periodic, so only the hands jump when a preview restarts.
- Verified 2026-10-05 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)); deterministic: yes

## Use it
New project: Create a Three.js scene with an environment map (createStudioEnvironment from Chrome Material), add createPocketWatch().group and call setTime(watchSeconds(info, { start })) every frame.

Existing project: Copy src/pocket-watch.js. Add watch.group to your scene, scale and place it, and call watch.setTime(seconds) from your frame loop. Your scene needs an environment map for the metal to look like metal.

Reuse ideas:
- Countdown or deadline scene: set the start time a few seconds before the hour and let it tick, with Rolling Counter or Kinetic Title beside it.
- Time-lapse: 'An hour per second' races the hands round for 'later that day' or 'all-nighter' moments.
- Luxury product shot: change the case metal and dial for a different brand feel and orbit it with Smooth Orbit Camera.

## Limitations
- Only the dial side is modelled: there is no movement or caseback to show.
- The hands show a 12-hour time; there is no date or day.
- At an hour per second the second hand is hidden, because it would strobe.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.
- three.js 0.185.1: MIT (https://github.com/mrdoob/three.js)

Provenance: Adapted from the owner's threejs-sketches/objects-scenes/pocket-watch (MIT), rebuilt for AI Pixel Wizard in October 2026: new lathe-turned case, crystal, font-free dial, Breguet hands and chain, the shared studio, and the frame/time contract.

