Capítulo 541 de 859
An exporter to compress geometry with the Draco library.
Draco is an open source library for compressing and decompressing 3D meshes and point clouds. Compressed geometry can be significantly smaller, at the cost of additional decoding time on the client device.
Standalone Draco files have a .drc extension, and contain vertex positions, normals, colors, and other attributes. Draco files do not contain materials, textures, animation, or node hierarchies – to use these features, embed Draco geometry inside of a glTF file. A normal glTF file can be converted to a Draco-compressed glTF file using glTF-Pipeline.
The exporter requires the Draco encoder to be loaded as a global script in advance:
<script src="https://cdn.jsdelivr.net/gh/google/draco@1.5.7/javascript/draco_encoder.js"></script>
const exporter = new DRACOExporter();
const data = await exporter.parseAsync( mesh, options );
import { DRACOExporter } from 'three/addons/exporters/DRACOExporter.js';
Constructor
| Signature |
|---|
new DRACOExporter() |
Properties
| Property | Description |
|---|---|
.MESH_EDGEBREAKER_ENCODING : number (constant) | Edgebreaker encoding. |
.MESH_SEQUENTIAL_ENCODING : number (constant) | Sequential encoding. |
Methods
| Method | Description |
|---|---|
.parse() | Deprecated: Use DRACOExporter#parseAsync instead. |
| `.parseAsync( object : Mesh | Points, options : DRACOExporter~Options ) : Promise.<Int8Array> (async)` |