I have a Javascript function that takes a base64 string as parameter. I then use the
window.atob(base64String);
function to get the binary of this file.
Essentially the data coming in is a .glb file that I pass from C# after converting it to a base64 String:
var buffer = await FileIO.ReadBufferAsync(File);
var bytes = buffer.ToArray();
//This is the data being passed to the Javascript function
var result = Convert.ToBase64String(bytes);
What should I do after I get the result of the window.atob() function to get the model and display it in THREE.js? As in be able to do this:
I have tried what you suggest but it didn’t work. I’m not sure what the rest of the GLTFLoader.parse() parameters sould be. Can I just pass the ArrayBuffer and then empty strings for the rest of them?
And yes I did post on StackOverflow but no one came back with an answer so I thought to come ask here as well.
So I’m trying your suggestion. I’d like to know what is the result of the GLTFLoader.parse() function?
Do I pass the result of the parse() function to the load() function or do I already have the result I need to show the model once I successfully parse the ArrayBuffer?