I am attempting to download a 3d object from Sketchfab within a React application.
I call the url to download a specific 3d object: https://api.sketchfab.com/v3/models/${itemId}/download
This returns urls that point to Amazon AWS, and there are three urls, one called glb, one called gltf and one called usdz.
If I access the object on Amazon using the gltf url, I get a response in the form of a zip file. If I unzip the file, I get the files associated with the gltf format. All good.
If however I access the object on Amazon using the glb url, the response appears not to be a zip file. It appears that I must have received the glb file, but it isn’t in a format that can be added to the canvas - see below. It seems to be an array buffer with multiple sections. Is there some additional processing needed on the glb response, in order to extract a glb file from it? Alternatively, how does this get added to the scene?
Array Buffer: ArrayBuffer(4255132)byteLength: 4255132
[[Prototype]]: ArrayBufferbyteLength: (…)constructor: ƒ ArrayBuffer()slice: ƒ slice()Symbol(Symbol.toStringTag): "ArrayBuffer"get byteLength: ƒ byteLength()
[[Prototype]]: Object[[Int8Array]]: Int8Array(4255132)
[[Uint8Array]]: Uint8Array(4255132)
[[Int16Array]]: Int16Array(2127566)
[[Int32Array]]: Int32Array(1063783)
[[ArrayBufferByteLength]]: 4255132[[ArrayBufferData]]: 6141