As a user who is logged-in to 3DStreet Editor, I would like to save my street glb to the cloud with a public URL so that I can access this glb from a third-party application. (Examples of the third-party applications that could make use of a 3dstreet glb: mozilla hubs, raytrace path renderer, ai rendering)
Implementation ideas:
let's start with this >> front-end: generate glb client-side and upload to cloud
front-end -- as an additional option for share menu, "Upload glTF to Cloud". Similar to saving screenshot as preview.jpg on firebase storage, this will create the glb file using the same client-side method as if a user is downloading the file locally and uploading it to firebase storage.
We will store the scene.glb file in the scenes/UUID/ directory in the same manner as scene preview images. For example, given a scene with id UUID, here is the path for the scene glb to be saved:
/scenes/UUID/scene.glb
Then the path to this file is saved in firebase firestore for this scene object as glbPath
therefore there can only be 1 glb file hosted per scene
how does user get this url to copy? how do they know it's ready?
what happens if it's a big file and they have slow internet?
not yet >> back-end: generate glb and save to cloud if not exist, otherwise just redirect to cloud
back-end -- create a cloud function, could respond to a route such as 3dstreet.app/scenes/UUID.glb
this function first checks to see if there is a value for glbPath for a given scene UUID
if so, then simply redirect to that URL via publicly exposed firestore
otherwise fire a script that generates a model for the scene
only one of these scripts may be running at a time. prevent multiple request race conditions.
if there is already a glb file the script should not save over existing
alternatives?
What other options are there besides 3dstreet hosting the glb?
local storage?
modify the hubs server to accept the glb as a POST request and create a new room using it. if I'm self hosting that would in theory maybe be possible, but probably really hard.
how to pass the scene id to hubs?
As a user wanting to start a hubs room featuring a 3dstreet scene given a scene UUID, and having saved a glb file in the cloud with an accessible url for given scene, how to have the 3dstreet scene UUID persist so that the Hubs Client can access that UUID to load a 3dstreet scene glb file?
As a user who is logged-in to 3DStreet Editor, I would like to save my street glb to the cloud with a public URL so that I can access this glb from a third-party application. (Examples of the third-party applications that could make use of a 3dstreet glb: mozilla hubs, raytrace path renderer, ai rendering)
Implementation ideas:
let's start with this >> front-end: generate glb client-side and upload to cloud
/scenes/UUID/scene.glb
not yet >> back-end: generate glb and save to cloud if not exist, otherwise just redirect to cloud
alternatives?
What other options are there besides 3dstreet hosting the glb?
how to pass the scene id to hubs?
As a user wanting to start a hubs room featuring a 3dstreet scene given a scene UUID, and having saved a glb file in the cloud with an accessible url for given scene, how to have the 3dstreet scene UUID persist so that the Hubs Client can access that UUID to load a 3dstreet scene glb file?