There’s a lot of demos and code that show how to load a file from URL or by using Json Parser, but none of these methods answer to my needs.
I have the content of a GLTF file, stored in a variable. The file itself doesn’t exist.
Pasting the variable into a .gltf file and loading it is a solution but not my goal here.
I’m trying to do something similar to this, but I’m not sure how the load method is trying to load and open a file. It’s not loading only the content given.
app.loader.load(gltf_in_variable, "binary", function (err, asset) {
var asset = new pc.Asset('gltf', 'model', {
url: ''
});
asset.resource = res.model;
asset.loaded = true;
app.assets.add(asset);
[...]
});
Thank you for your help.