huggingface / gsplat.js

JavaScript Gaussian Splatting library.
MIT License
1.26k stars 78 forks source link

Merge Scenes #40

Closed jeyemwey closed 6 months ago

jeyemwey commented 7 months ago

I want to add dynamic content, such as arrows, markers etc. into the scene.

For this reason, I have written code that will build a synthetic scene which contains a cube, a triangle etc by filling a boundary with splats. I can modify the new scene (scaling, translating, ...) to my liking. Next, I want to "add" the splats to the existing world, and, ideally, modify the positions of the subscene after they were added to the scene. Do you have an idea, how we can process this? Ideally, the subscene would just use a portion of the _data buffer from the larger scene, but I'm not sure if that's possible in JS.

dylanebert commented 7 months ago

I think this is a great idea, and will require some refactoring of the scene representation to make it easier to manipulate.

There will be some trade-off between usability and overhead. I can work on a PR for this, and see how I might be able to do it without adding too much overhead.

If you have any ideas let me know

dylanebert commented 7 months ago

I have refactored the Scene class by separating out the render data packing into renderers/webgl/utils/RenderData.

Now, you only need to worry about manipulating the positions, rotations, scales, and color matrices directly, which should make a future update for editing tools much easier.