Reputation: 103
I exported a model from Blender using the three.js exporter, and managed to load it correctly using the JSONLoader. But I need now to store the JSON information in a variable and parse it to display the model, without loading an external file.
According to the docs, I could do it using the parse function from the GeometryLoader (http://mrdoob.github.com/three.js/docs/56/#Reference/Loaders/GeometryLoader), but I checked the source at github and saw that it doesn't exist. I'm not sure wether the documentation is outdated or serving as a guide for future implementations, and could find no further information on how to do this parsing. Does anybody have any idea?
Thanks in advance.
Upvotes: 1
Views: 1451
Reputation: 670
In the JSONLoader you have the method createModel
that should do what you want: this method is called by loadAjaxJSON
when the JSON data string has been retrieved by the Ajax request.
The createModel
method has this signature:
createModel = function ( json, callback, texturePath )
Upvotes: 2