![](/img/trans.png)
[英]How can I load client .STL file into three.js scene instead of loading from server?
[英]How can I save and then load a Three.js scene
我看过物体和其他东西的装载机,但整个场景都没有。 是否可以保存和加载three.js场景?
是的,您可以使用THREE.SceneLoader:
要导出使用此:
var exporter = new THREE.SceneExporter();
var sceneJson = JSON.stringify(exporter.parse(scene));
要导入使用此:
var sceneLoader = new THREE.SceneLoader();
sceneLoader.parse(JSON.parse(json), function (e) {scene = e.scene;}, '.');
有关示例,请参阅: https : //github.com/josdirksen/learning-threejs/blob/master/chapter-08/04-load-save-json-scene.html
加载程序和导出程序的源文件位于:
看起来像场景导出器已被弃用。 现在有一个GLTFExporter
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.