13

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 player.

I have tried ObjectExporter and SceneExporter. But still can not understand how to load this data back into ThreeJS environment.

What is the right way to do this?

2
  • I made a map in Three.js using JSON and stored it to a file. All of the information from the map was stored there, so I wrote a function that would read it from the file. Commented Sep 2, 2013 at 23:26
  • Most likely you'll have to use OBJLoader to import your scene. I'm also on same issue like you, we'll see how we can work it out. Could you post your export code (using ObjectExporter, SceneExporter)? Commented Oct 16, 2013 at 9:24

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

And how to import scene in other file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.