How to use the @xviz/builder.GLBBufferUnpacker function in @xviz/builder

To help you get started, we’ve selected a few @xviz/builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / streetscape.gl / examples / converters / point-cloud-ply / src / convert.js View on Github external
import fs from 'fs';
import path from 'path';
import readline from 'readline';
import Stream from 'stream';
import {
  GLBContainer,
  GLBBufferPacker,
  GLBBufferUnpacker,
  addglTFBufferDescriptors
} from '@xviz/builder';

import {getRange, toArrayBuffer, toBuffer} from './utils';

const MAX_POINTS = 42000000;
const bufferPacker = new GLBBufferPacker();
const bufferUnpacker = new GLBBufferUnpacker();

function runPacker(data) {
  const posRange = [
    {
      min: Number.POSITIVE_INFINITY,
      max: Number.NEGATIVE_INFINITY
    },
    {
      min: Number.POSITIVE_INFINITY,
      max: Number.NEGATIVE_INFINITY
    },
    {
      min: Number.POSITIVE_INFINITY,
      max: Number.NEGATIVE_INFINITY
    }
  ];