mkkellogg / GaussianSplats3D

Three.js-based implementation of 3D Gaussian splatting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

select and move splat scene

TianyuHuang-000 opened this issue · comments

Thank you for your great work.

I'm trying to use the viewer to load multiple splat scenes and move them like normal three objects.
It seems like we can't determine the scene index with your raycaster, and using normal threejs raycaster can only select a invisible mesh at very center of the splat scene and control whole viewer.
Any hint on how can i achive use raycast select individual splat scenes?
And after selection I think I will be able to attach the splat to Transform control and move it.

You should be able to to use the splat index to determine the scene index with something like:

  viewer.raycaster.intersectSplatMesh(viewer.splatMesh, hits);
  if (hits.length > 0) {
      const closestHit = hit[0];
      const sceneIndex = viewer.splatMesh.getSceneIndexForSplat(closestHit.splatIndex);
 }

Thank you very much for your response. I am now able to set the visibility of the selected scene index.
Could you please suggest a method to attach the Transform control from Three.js to the selected scene?
In DropInViewer, I can attach the viewer to the Transform control, but I am unsure how to attach the splat scenes.

Sorry for the late response, there isn't really a way to attach Transform controls to an individual splat scene, it has to be attached to DropInViewer or Viewer.splatMesh.

I had (sort of) the same issue and solved it by using an invisible three.js cube to attach to the transformcontrol and then syncing the splatMesh using:
transformControl.addEventListener('objectChange', () = > { /* update active splatMesh here */ } )

Maybe something like that could work for you as well @TianyuHuang-000