josdirksen / learning-threejs

Code repository for the examples from the Packt book "Learning Threejs"
3.1k stars 1.27k forks source link

Code doesn't work #8

Open jfoxworth opened 9 years ago

jfoxworth commented 9 years ago

Tried to use the SceneExporter code to export a scene to a JSON object. Got this error.

Uncaught TypeError: Expecting a function in instanceof check, but got undefined

ashleynguci commented 4 years ago

I got the same problem. The newest solution is THREE has replaced SceneExporter && ObjectExporter with GLTFExporter.

var exporter = new THREE.GLTFExporter();

// Parse the input and generate the glTF output exporter.parse( scene, function ( gltf ) { console.log( gltf ); downloadJSON( gltf ); }, options );

Hope it help.

https://threejs.org/docs/#examples/en/exporters/GLTFExporter