wasm-spatial-core
    Preparing search index...

    Function terrainToGlb

    • Convert a terrain heightmap directly to a GLB mesh (TRIANGLES primitive mode).

      Automatically generates normals from the height gradient.

      Arguments

      • heights: Float32Array of elevation values (row-major, bottom-to-top or top-to-bottom)
      • width: Number of columns in the grid
      • height: Number of rows in the grid
      • bounds: [west, south, east, north] in geographic or projected coordinates

      Returns

      Uint8Array containing the complete GLB binary.

      Parameters

      • heights: Float32Array
      • width: number
      • height: number
      • bounds: Float64Array

      Returns Uint8Array