GLTFExporter

An exporter for glTF 2.0 assets.

Extensions

GLTFExporter supports the following glTF 2.0 extension:

Code Example

const exporter = new v3d.GLTFExporter(); exporter.parse( app.scene, function(gltf) { console.log(gltf); }, function(error) { console.log('glTF export failed!'); }, options );

Constructor

GLTFExporter()

Creates a new GLTFExporter.

Methods

.parse(input : Object3D, onCompleted : Function, onError : Function, options : Object)

input
Scene or objects to export.
onCompleted
Will be called when the export completes. The argument will be the generated glTF JSON or binary ArrayBuffer.
onError
Will be called if there are any errors during the glTF generation.
options
Export options:

Export scene/objects to to glTF 2.0 format.

.parseAsync(input : Object3D, options : Object) → Promise

Export scenes/objects to to glTF 2.0 format.

Similar to .parse() method, but returns a promise value instead of calling callbacks.

Source

For more info on how to obtain the source code of this module see this page.