threejs-worldgen
    Preparing search index...

    Class LocalFrame

    A locally flat frame on a world: x east, z south (three.js convention: −z is north), y up. On a flat world it is the world itself. On a planet it is the tangent plane at a latitude/longitude, accurate for tens of kilometres — enough for grass, forests, rivers and cities. Heights include the planet's curvature drop, so things placed with it sit exactly on the rendered sphere.

    Index
    east: Vec3

    Unit east vector.

    north: Vec3

    Unit north vector.

    origin: Vec3

    Planet-centred position of the frame origin on the base sphere (zero on a flat world).

    up: Vec3

    Unit up vector.

    • Base-surface point under local (x, z), planet-centred.

      Parameters

      • x: number
      • z: number
      • out: Vec3 = ...

      Returns Vec3

    • Local height at (x, z): what a (x, z) => y height function should return.

      Parameters

      • x: number
      • z: number

      Returns number

    • Everything about local (x, z). elevation is converted to local y (curvature included).

      Parameters

      • x: number
      • z: number
      • Optionalout: WorldSample
      • minWavelength: number = 0

      Returns WorldSample

    • Converts local (x, y, z) to a planet-centred position (identity on a flat world).

      Parameters

      • x: number
      • y: number
      • z: number
      • out: Vec3 = ...

      Returns Vec3