How to export and then import a scene with Three JS?

后端 未结 1 396
清酒与你
清酒与你 2021-02-13 17:43

I have a complex 3D scene builded with Three JS and a lot of Javascript code. I need to export this scene as one file and then use it on my site with a simple ThreeJS scene play

相关标签:
1条回答
  • 2021-02-13 18:23

    SceneExporter does not export the scene objects that are loaded through JSON ObjectExporter can't exports texture

    link scripts

    ObjectExporter.js
    GeometryExporter.js
    BufferGeometryExporter.js
    MaterialExporter.js
    
    function exportScene(save, type) {
        exporter = new THREE.ObjectExporter;
        var obj = exporter.parse(scene);
        var json = JSON.stringify(obj);
        log(json);
    }
    

    save json to file ext .json Library taken from https://github.com/mrdoob/three.js/tree/master/examples/js/exporters Loader taken from https://github.com/mrdoob/three.js/tree/master/editor default import in editor menu->file->import I'm working on that to add the ability to export texture

    0 讨论(0)
提交回复
热议问题