How to use the gltf-pipeline.gltfToGlb function in gltf-pipeline

To help you get started, we’ve selected a few gltf-pipeline examples, based on popular ways it is used in public projects.

github AnalyticalGraphicsInc / 3d-tiles-tools / samples-generator / lib / createGltf.js View on Github external
'use strict';
var Cesium = require('cesium');
var gltfPipeline = require('gltf-pipeline');
var path = require('path');
var Promise = require('bluebird');
var getBufferPadded = require('./getBufferPadded');

var Cartesian3 = Cesium.Cartesian3;
var defaultValue = Cesium.defaultValue;
var defined = Cesium.defined;

var gltfToGlb = gltfPipeline.gltfToGlb;

module.exports = createGltf;

var rootDirectory = path.join(__dirname, '../');

var sizeOfUint8 = 1;
var sizeOfUint16 = 2;
var sizeOfFloat32 = 4;

/**
 * Create a glTF from a Mesh.
 *
 * @param {Object} options An object with the following properties:
 * @param {Mesh} options.mesh The mesh.
 * @param {Boolean} [options.useBatchIds=true] Modify the glTF to include the batchId vertex attribute.
 * @param {Boolean} [options.relativeToCenter=false] Set mesh positions relative to center.

gltf-pipeline

Content pipeline tools for optimizing glTF assets.

Apache-2.0
Latest version published 3 months ago

Package Health Score

81 / 100
Full package analysis

Similar packages