threejs-worldgen
    Preparing search index...

    Class PopulationOverlay

    A hex choropleth over the terrain: one prism (or flat tile) per H3 cell, coloured by density, land use, night lights or habitability, plus the road / rail / power network as lines. With resolution: 'auto' it switches to coarser, parent cells (exact sums of their children) as the camera pulls away.

    const overlay = new PopulationOverlay({ population, camera, mode: 'density', extrude: 600 })
    scene.add(overlay.object)
    renderer.setAnimationLoop(() => { overlay.update(); renderer.render(scene, camera) })
    Index
    camera?: Camera

    Camera for 'auto' resolution.

    object: Group<Object3DEventMap> = ...

    Add this to your scene.

    Resolved settings.

    population: Population

    The population drawn.

    resolution: number = -1

    H3 resolution currently drawn.

    • Call once per frame: picks the resolution for the camera distance and keeps the origin current.

      Returns void