I uploaded a model in .glb format to S3 services and obtained the URL
https://test-image-prevaa-123.s3.amazonaws.com/test/1626336255367.octet-stream
. How can I load this model into three.js? When I tried loading it from my code, the model failed to display. I am new to three.js and encountered the error in the console Unexpected token g in JSON at position 0
. I suspect that after uploading the .glb file to S3 services, the file format changed to .octet-stream. I am unsure about how to load a .octet-stream file into three.js. Thank you for any suggestions on loading a .octet-stream model into three.js.
Here is my code:
const data = this
const loaderFile = new THREE.FileLoader()
loaderFile.load(newFile, async function (file) {
const loader = new GLTFLoader()
loader.parse(file, '', function (glb) {
const mesh = glb.scene
mesh.scale.set(2, 2, 2)
data.scene.add(mesh)
data.animate(mesh)
})
})