How to add 3D element using Model-Viewer

Hello everyone, I’m trying to add a 3D element (.glb file) to my website to see if it’s compatible with ReadyMag. I’ve used the code that’s given through Model-Viewer https://modelviewer.dev and it works with assets provided through them.

However I’m trying to upload my own .glb file and have it work the same as the astronaut asset from Model-Viewer. I’ve tried uploading the .glb file to Google Drive, Github, and Glitch and have had no success implementing the URL of the asset in the code.

For reference this is the code that works with the model-viewer astronaut asset:

model-viewer { height : 600px; width : 400px; }

So I want to change the model-viewer src= to the link of my .glb file. Wondering if there are any CORS with ReadyMag that I’m unaware of and that’s why it’s not working for me.

Apologies if this is a simple and dumb question, I am so new to coding and I know nothing.

hey, implementing this works quite good.
Have you checked if your glb file works in the 3dmodelviewer editor? You can upload it, make changes, and download it again. After that, host it on your server. It could be possible that you have to set up a .htaccess file inside your filehosting to deal with the CORS problem.

Do you get any errorcode from the browser dev-tools console?

Thanks for responding ! My asset works when I load it into the editor, I’m just running into an issue where I don’t know where to host my .glb file and get a URL to implement into the code. I’ll try redownloading my asset from the editor though, I don’t think I’ve tried that ! Do you have any recommendations on where to host it? I tried GitHub, but couldn’t get the raw.github URL that I needed.

I´m mainly hosting my files on my webspace I buy from my domainprovider.
Its often only 3 to 4 Euro/$ a month for some webspace.