How to add glb file model with help of input file to the scene

Hello everyone I need a help, I am trying to add glb file to scene with <input type="file">.
I am using FileReader API and starting from there I don’t have any idea how to move on, I can get glb file content as string as it is similar to json file, with help of FileReader have anyone Ideas how to add that data to the scene?
Regards Thank You

1 Like

From the FileReader API you should be able to get an ArrayBuffer for the GLB file – once you have that, you can pass it into GLTFLoader’s parse( buffer, '', ... ) method. Since everything is embedded in the GLB, you can just use an empty string for the resource path.

https://threejs.org/docs/#examples/loaders/GLTFLoader.parse

1 Like

Thank You very Much You Helped me :blush: :slight_smile:

1 Like