DRACO导出器([name])

一个用于使用 Draco 库压缩几何体的导出器。

[link:https://google.github.io/draco/ Draco] 是一个用于压缩和解压缩 3D 网格和点云的开源库。压缩后的几何体可以显著减小文件大小,但在客户设备上需要额外的解码时间。

独立的 Draco 文件具有 `.drc` 扩展名,包含顶点位置、法线、颜色和其他属性。Draco 文件不包含材质、纹理、动画或节点层次结构 - 要使用这些功能,请将 Draco 几何体嵌入到 glTF 文件中。可以使用 [link:https://github.com/AnalyticalGraphicsInc/gltf-pipeline glTF-Pipeline] 将普通的 glTF 文件转换为经过 Draco 压缩的 glTF 文件。

导入

[name] 是一个附加组件,必须显式导入。请参阅 [link:#manual/introduction/Installation Installation / Addons]。

import { DRACOExporter } from 'three/addons/exporters/DRACOExporter.js';

代码示例

// Instantiate a exporter const exporter = new DRACOExporter(); // Parse the input and generate the DRACO encoded output const binaryData = exporter.parse( mesh, options );

例子

[example:misc_exporter_draco]

构造函数

[name]()

创建一个新的 [name] 实例。

方法

[method:Int8Array parse]( [param:Mesh object] | [param:Points object], [param:Object options] )

[page:Mesh object] | [page:Points object] — 要编码的网格或点。
[page:Options options] — 可选的导出选项

源代码

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