playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.68k stars 1.35k forks source link

Getting the click point on a splat #7075

Open willeastcott opened 1 week ago

willeastcott commented 1 week ago

It is not obvious how to derive the world space coordinate of a click/touch on a splat. Presumably, you would do one of these two options:

  1. Get the depth of the pixel at the click point and then transform back into world space. I guess this requires a depth render pass.
  2. Get the gaussian that was clicked and then figure out the intersection point on the gaussian plane.

Either way, we need to make this easier for people. Ideally, we would have a tutorial Editor project demonstrating how its done. But I'm logging this here because there may be some foundational engine work to make this easier to implement for an end user.

mvaligursky commented 1 day ago

related to https://github.com/playcanvas/engine/issues/6974

mvaligursky commented 1 day ago

forum thread: https://forum.playcanvas.com/t/click-coordinates-for-annotations-with-gaussian-splats/38101