Flying stuff architecture

This experiment is intentionally “zero-build”: it runs as plain ES modules and loads Three.js from a CDN importmap.

High-level flow

flowchart TD
  indexHtml[index.html] --> mainJs[main.js]
  mainJs --> appInit[initFlyingStuff]
  appInit --> threeScene[THREE_Scene_Camera_Renderer]
  appInit --> flyersFactory[createFlyers]
  flyersFactory --> flyersSim[Pool_Sim_Update]
  flyersSim --> renderables[Sprites_or_DepthMeshes]
  appInit --> rafLoop[RAF_loop_or_Snapshots]
  rafLoop --> flyersSim
  rafLoop --> rendererRender[renderer.render]

Ownership & responsibilities

Public API contracts

initFlyingStuff({ container })

Creates and starts the experiment. Returns an object with:

createFlyers(scene, camera, opts)

Creates a THREE.Group under scene and returns an object used by app.js:

Important invariants:

Performance notes