• Compresses a flat array of 3D positions into a quantized format, and computes the matrix for decompressing back to the original range.

    Parameters

    • array: FloatArrayParam

      The array of 3D positions to be compressed.

    • min: Vec3

      The minimum bounds for the 3D positions.

    • max: Vec3

      The maximum bounds for the 3D positions.

    Returns { decompressMatrix: Mat4; quantized: Uint16Array<any> }

    • An object containing the quantized positions and the decompression matrix.
    const positions = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6];
    const min = [0, 0, 0];
    const max = [1, 1, 1];
    const { quantized, decompressMatrix } = compressPositions3(positions, min, max);