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.