I am working on a project where I need to create a function that can load a 3D object into ThreeJS. The user will upload the file onto our website, and it could be in various formats such as STL, JSON, Babylon, Collada, etc.
Currently, my code only supports loading one specific format, which is shown below:
// BEGIN Clara.io JSON loader code
var objectLoader = new THREE.ObjectLoader();
objectLoader.load('clara.json', function(obj) {
object = new THREE.Mesh(obj);
scene.add(object);
});
Is there a way in ThreeJS or any other method available that can automatically load the 3D object into the scene based on the uploaded file format?