mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.97k stars 35.33k forks source link

Load external three.js script inside a main scene. Next step for metaverses. #23178

Closed DanielAbalde closed 2 years ago

DanielAbalde commented 2 years ago

Hey experts. I'm wondering how 3D/VR web content can be nested so that metaverses/webspaces can load external procedural 3D/VR content (done by code, not 3d assets). For example, a NFTs 3d gallery to load three.js based NFTs and display them as interactive/procedural 3d in a limited region of the gallery. That sounds like future, right?

I've searched and well, seems like it's far from being a reality. One approach is to do some css3d tricks to display an interactive html page, but I haven't seen this could bring 3D to the main scene, it is just a flat interactive texture.

So, what's missing in the current technology state?

Somehow it has to be done, let's look for the least bad way. Maybe export the external html/js in such a way that the main scene can call a method and input its renderer, camera, local position/orientation/whatever to the external scene? so that the external three.js script works like a parametric component rather than a global scene, so it should have two ways of run the script (standalone as currently and as a function). The security problem of loading external sources can be solved by just accepting trusted sources (reading the code to validate) and ensuring its immutability by storing it in repositories like IPFS, right? Or even then would it be a risk?

It is something that has to happen definitely, can you experts speculate how it could be? Thank you.

WestLangley commented 2 years ago

Sorry, this is not a help site. Please post on the three.js forum, instead.