Skip to main content

GLTFWriter

The GLTFWriter is a writer for glTF scenegraphs.

LoaderCharacteristic
File Extensions.glb,.gltf
File TypesBinary, JSON, Linked Assets
Data FormatScenegraph
File FormatglTF
Supported APIsencode, encodeSync

Usage​

import {GLTFWriter} from '@loaders.gl/gltf';
import {encodeSync} from '@loaders.gl/core';

const arrayBuffer = encodeSync(gltf, GLTFWriter, options);

Options​

OptionTypeDefaultDescription
DracoWriterDracoWriternullTo enable DRACO encoding, the application needs to import and supply the DracoWriter class.
DracoLoaderDracoLoadernullTo enable DRACO encoding, the application needs to import and supply the DracoLoader class.