Closed snapo closed 1 year ago
Hi @snapo! This seems like a question about the three.js library, I think? I don't know what gltfExplorer.js
is, if that's important context. For three.js questions I would recommend asking on https://discourse.threejs.org/, or on the Slack, Discord, and Stack Overflow channels for three.js, listed on the three.js website (https://threejs.org/).
I would also just note that THREE.GLTFLoader's .load( url )
method can be given a Data URI, you don't need to convert it to a File object unless you have a .gltf
file with references to other external resources in other Data URIs.
thanks , i will try the .load(urlobject) ... this might help.
Hi, (NOT A ISSUE/BUG) I use the library a lot (not a javascript developer, therefore excuse my question) , because i develop locally and do not want to disable CORS , i would like to embed the GLTF file directly base64 encoded...
From the index.html (sample) the filename is then provided to the gltfExplorer.js via a function call. That functioncall is then executed from the gltfExplorer.js
When i use the default and load the html file i get a CORS error. So because of that and as i re-write the files automatically, i would like to add the file base64 embedded in the javascript or HTML file.
From Stackoverflow i got the following: https://stackoverflow.com/questions/35940290/how-to-convert-base64-string-to-javascript-file-object-like-as-from-file-input-f
But no matter (no javascript developer) how i try it i do not get it working to read the file from a variable (base64 encoded) instead of the fileurl link...
If i get any hint on where everywhere i would have to change it it would be realy appreciated.