[name]

An exporter for *glTF* 2.0.

glTF (GL Transmission Format) is an open format specification for efficient delivery and loading of 3D content. Assets may be provided either in JSON (.gltf) or binary (.glb) format. External files store textures (.jpg, .png) and additional binary data (.bin). A glTF asset may deliver one or more scenes, including meshes, materials, textures, skins, skeletons, morph targets, animations, lights, and/or cameras.

Extensions

GLTFExporter supports the following [link:https://github.com/KhronosGroup/glTF/tree/master/extensions/ glTF 2.0 extensions]:

Example

// Instantiate a exporter var exporter = new THREE.GLTFExporter(); // Parse the input and generate the glTF output exporter.parse( scene, function ( gltf ) { console.log( gltf ); downloadJSON( gltf ); }, options ); [example:misc_exporter_gltf]

Constructor

[name]()

Creates a new [name].

Methods

[method:null parse]( [param:Object3D input], [param:Function onCompleted], [param:Object options] )

[page:Object input] — Scenes or objects to export. Valid options:

[page:Function onCompleted] — Will be called when the export completes. The argument will be the generated glTF JSON or binary ArrayBuffer.
[page:Options options] — Export options

Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects)

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/js/exporters/GLTFExporter.js examples/js/exporters/GLTFExporter.js]