Encoding the model into HTML (show model without server/without cors restrictions)


I stumbled upon the .html file that is exported from Rhino. I’ve attached the file. As you can see the scene can be opened and the 3D content is shown. If I try this with any Babylon project of course, that content is not loaded due to CORS, which makes sense. Now, I have a client that would like to have something like the file I’ve attached, and I am not sure how to achieve that.

I tried to investigate the file and it seems like the 3D model is encoded somehow into the app. But I don’t quite understand what is going on and how is that achieved.

Do you guys have any ideas about this?

Thank you

3d_c.zip (671.6 KB)

I guess the best option is simply to store the model as a base64 and then load it from the string like here: