Thanks a lot for explaining what you want to achieve. And yes, that sounds exactly the kind of projects Iāve designed polygonjs for.
Iād start like this:
- add a sop/dataUrl node to your scene.
This is the node whose job is to fetch a url, and translate that to 3d data. It will basically create points with attributes, and then you can use that to create what you want.
It expects a url which returns json data, like :
[
{"P":[0,0,2],"scale": 0.7},
{"P":[0,0,-2],"scale": 1.4},
{"P":[1,0,-2],"scale": 1.0}
]
So you wouldnāt have to learn SQL, you would just need to get the data from your database with a url.
If you upgrade to 1.2.33, Iāve just added some presets to it, to give you a starting point.
And you can try it from this example, where the data from the returned json is used to drive the scale of sphere. And it could be used to drive anything.
- Load your scene on bubble.
Once youāve saved your scene, youād have to get the exported javascript files to connect with bubble. Iām not sure if it would be best to have a similar approach to webflow (where the files are uploaded to polygonjs cloud, and you load them from there - see tutorial), or if you should copy them on bubble.
Once youāve uploaded the files where you need, youād have to load the js and create the scene on your bubble app, with something like:
import {loadScene_scene_01} from './src/polygonjs/scenes/scene_01/autogenerated/loadScene'
const loadedData = await loadScene_scene_01({
domElement: 'app'
});
(where youād need to adapt the import path, change āappā to the element youād create the 3d viewer in, and replace āscene_01ā by the name of your scene).
You can also use the webflow tutorial above, or this repo to see how it is loaded. And when you export locally, it creates an index.html which also contains a similar snippet you could use.
Iāll try and take a look at bubble this week, so hopefully Iāll be able to give better recommendation for this second part. And Iāll get back to you once I know a bit more. But hopefully this explanation can still help you get started. Donāt hesitate to let me know if anything is confusing of course.