donmccurdy / three-gltf-viewer

Drag-and-drop preview for glTF 2.0 models in WebGL using three.js.
https://gltf-viewer.donmccurdy.com/
MIT License
2.06k stars 530 forks source link

Passing S3 presigned URL to model? #360

Closed munsanje closed 5 months ago

munsanje commented 5 months ago

I see you can pass a link to a web resource via #model=. This works for public resources, including those on S3. However, it fails for private resources passed via a presigned URL with the response 400: Bad Request. Any workarounds here?

donmccurdy commented 5 months ago

If you aren't already, you'll probably want to use self-contained files (like .glb) with presigned URLs. If you use a .gltf with external .bin and texture resources, requests for those external resources will not be presigned unless the resource URLs embedded in the .gltf file are also presigned.

This viewer doesn't have any special-case handling for S3 URLs, I believe #model=<presigned-url>.glb should just work, unless there are other restrictions (HTTP Referrer maybe?) on the URL.