Function compressPositions3

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

    Parameters

    Returns { decompressMatrix: FloatArrayParam; quantized: Uint16Array<ArrayBuffer> }

    • 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);