scientist-softserv / britishlibrary

Other
3 stars 0 forks source link

Display BL 3D Files #579

Open NoraRamsey opened 1 week ago

NoraRamsey commented 1 week ago

If a code was embedded into the repository in order to automate access to 3d files we could add a url link that will take the visitor away from the repository site in order to view the image in a 3d viewer hosted in Glitch (or elsewhere)

Our bl labs team mentioned:

You would need to change the CORS policy on the repository server to allow access from glitch.me (or the domain you are using) by adding something like this to your server config: Access-Control-Allow-Origin: https://[glitch project name].glitch.me

or the possibly riskier option that allows connections from everywhere: Access-Control-Allow-Origin: * A lot of APIs have the second option set I think to allow remote usage.

MDN has a good explanation: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Here is the URL for this experiment: https://lgh-model-viewer-example.glitch.me/blrepo3d.html

To use it do the following:

Go to a repository page for a model Download the file ending in "_gltf.zip" to your computer Go to the URL above and use the "Browse" button to upload the file After a couple of seconds you should see the model.