-
Hello, I want to get a file from server via request and then import it into the scene. I know how to do it if the file is in glb format(this but changing it to request). However I cannot figure out how to load a glTF file the same way. The glTF looks like this: The documentation says: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi, It's meant like so: async void LoadGltfBinaryFromMemory() {
var filePath = "/path/to/file.glb";
byte[] data = File.ReadAllBytes(filePath);
var gltf = new GltfImport();
bool success = await gltf.LoadGltfBinary(data, new Uri(filePath));
if (success) {
success = gltf.InstantiateMainScene(transform);
}
} So the URI provided is the one of the hth |
Beta Was this translation helpful? Give feedback.
Hi,
Granted, that example code is not clear at all.
It's meant like so:
So the URI provided is the one of the
.gltf
file. It'll be used as reference for relative URIs within the JSON.hth