Add functions to generate scenegraphs in json for the three.js renderer