threejs-worldgen
    Preparing search index...

    Function clipPlanes

    • Near and far clip planes for a camera height metres above the ground below it, on a planet of radius, from an ant on a leaf to deep space. Near shrinks with height (never below minNear); far reaches over the horizon to the top of the atmosphere, and out to reach metres from the planet centre when that is farther (e.g. the moon's apogee). Pair it with reversedDepthBuffer: true.

      Parameters

      • height: number
      • radius: number
      • atmosphereHeight: number = 100_000
      • reach: number = 0
      • minNear: number = 0.001

      Returns [number, number]

      [near, far].