Research notes on balloons, fireworks, flame and gems
Before building the next effects, balloons, fireworks, a torch and crystals, I had the research done first. Four notes came out of it on 1 October, each ending in decisions and in what it could not find, and the fireworks had a first cut by the end of the day.
The research plan sets the rules. Existing tools come first: before any physics, search for libraries, record each one’s licence, size and what it lacks, then decide adopt, port or build, and start from scratch only if nothing existing would help. Permissive licences only (MIT, BSD, Apache-2.0, ISC, CC0, Unlicense).
Every claim needs a source, and anything not from a source is marked as an estimate. Every note ends in a Decisions section.
Balloons: adopt the physics, build the latex
Rapier 2D, a physics library, is adopted for bodies and rope joints. The renderer is built, because every balloon library found is SVG or CSS keyframes with no lighting.
The note’s most useful number is for the pop: cracks run at up to 570 m/s, so an 11-inch balloon is gone in about 1 to 5 ms against a 16.7 ms frame. A realistic pop is therefore one frame of torn, retracting skin.
The first cut’s balloons were misshapen, with half bulges on the sides. The note fixes that by measuring a product photograph of an 11-inch balloon for its silhouette only: crown to neck 1.30 times the width, widest 41.5% of the way down, fitted to within 0.6% of the half-width (rms, the root-mean-square error). Still unknown, and listed as such: whether natural latex fluoresces under a black light.
Fireworks: built from physics, because no library was
None of the web libraries is physical: one uses unitless per-frame constants, another pure #0000FF blue. The note builds from physics and treats photos and one video as calibration targets, never as sprites (ready-made pictures pasted in).
Burst sizes come from the Japan Pyrotechnics Association table, which measures shells in go: a 10-go shell bursts at 330 m and spreads 280 m.
Computing the colour from molecular emission bands (the colours each chemical gives off) shows blue gives the eye about 2% of the brightness sodium yellow gives for the same watts, which is why blue is notoriously hard.
The light list holds four lights, so at most three burst lights, and the page must not flash more than three times a second (WCAG 2.3.1, the web accessibility rule on flashing). Unknown: a measured star ejection speed and a strobe rate. A first cut, peony shells with the burst light on the measured envelope, was in by the end of the day.
Flame: flicker follows the size of what burns
A buoyant flame puffs at roughly 1.5 divided by the square root of its diameter in metres: 6.7 Hz for a 5 cm torch head, 9.5 Hz for the road flare, 2.4 Hz for a campfire (computed). A measured juniper torch gave 14 cd, about a fifth of a 60 W bulb, so the room dims while it burns.
Every amplitude in the note is an estimate, and filming a real torch at 240 fps would settle them.
Gems: a plan with no code yet
Quartz becomes a 13-plane shape in the existing ray tracer for solid glass. Opal is a volume Bragg mirror, a regular structure that reflects one colour, with 250 nm spheres giving 579 nm at 0° and 459 nm at 60°.
The research plan lists gems as not started. Where secondary sources disagree on fire opal’s UV glow, the note records the disagreement and does not pick.
Sources and notes (13)
- Moulinet and Adda-Bedia 2015, balloon bursting (PRL) — cracks run at up to 570 m/s, so a pop is over in one frame
- Michaels, 11" Standard Latex Balloon — the product photograph the balloon silhouette was measured from
- San-en Fireworks, shell sizes (citing JPA 2009) — burst height and spread by shell size
- Pyrotechnic colorant (Wikipedia) — molecular emission bands behind the colour and the blue 2% figure
- WCAG 2.3.1, three flashes or below threshold — the limit of three flashes a second
- Xia and Zhang, flame puffing frequency (arXiv 1803.10400) — the 1.5 over root D puffing law
- Medina-Alcaide et al. 2021 (PLOS ONE) — the measured 14 cd juniper torch
- Yokota and Fujishiro, visual simulation of opal — Bragg-Snell opal rendering and sphere sizes
- Research plan — the notes this was written from
- Balloons — the notes this was written from
- Fireworks — the notes this was written from
- Flame — the notes this was written from
- Gems — the notes this was written from
Light & shadowAll 19 parts →
