Capítulo 552 de 859
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.
GLTFExporter supports the glTF 2.0 extensions:
The following glTF 2.0 extension is supported by an external user plugin:
const exporter = new GLTFExporter();
const data = await exporter.parseAsync( scene, options );
Constructor
| Signature |
|---|
new GLTFExporter() |
Properties
| Property | Description |
|---|---|
| `.textureUtils : WebGLTextureUtils | WebGPUTextureUtils` |
Methods
| Method | Description |
|---|---|
| `.parse( input : Scene | Array.<Scene>, onDone : GLTFExporter |
| `.parseAsync( input : Scene | Array.<Scene>, options : GLTFExporter~Options ) : Promise.<(ArrayBuffer |
.register( callback : function ) : GLTFExporter | Registers a plugin callback. This API is internally used to implement the various glTF extensions but can also used by third-party code to add additional logic to the exporter. |
| `.setTextureUtils( utils : WebGLTextureUtils | WebGPUTextureUtils ) : GLTFExporter` |
.unregister( callback : function ) : GLTFExporter | Unregisters a plugin callback. |