模型导出
GLTF Export
你将学到什么
- GLTFExporter.parse 导出场景
{ binary: true }→ glb;否则 gltf JSONembedImages: true内嵌贴图
效果说明
加载 house.obj,点击「导出模型」下载 scene.glb。
js
exporter.parse(scene, (result) => {
const blob = result instanceof ArrayBuffer
? new Blob([result], { type: 'model/gltf-binary' })
: new Blob([JSON.stringify(result)], { type: 'model/gltf+json' });
// download blob...
}, { binary: true, onlyVisible: true, embedImages: true });小结
基础案例 · Three.js · 33/35
