To my understanding - and I’d like to stand corrected here - there currently is no functionality that explicitly covers picking of Gaussian splats in CesiumJS. I opened Picking for Gaussian splats · Issue #13326 · CesiumGS/cesium · GitHub with a few first thoughts. But maybe someone has ideas for easy or quick workarounds.
The first sandcastle that you posted was using Gaussian splats. Is anything that you are going to do related to Gaussian splats? If it is, then the response is that we don’t have a concept for “picking” on Gaussian splats. Even if we had such a concept, then there certainly is no sensible concept for a “normal” of a picked Gaussian splat point. (It’s trivial to compute that in theory. It’s hard to do this in CesiumJS in practice. It would likely not make any sense, neither in theory nor in practice).
The second sandcastle uses a “Model”, namely that balloon glTF model. This is added as an ‘entity’. Is the task that you are trying to accomplish really focussed on a glTF model entity? Or are you trying to pick points on a tileset? In both cases (for the standalone ‘entity’, as well as the tileset), the actual picking will happen based on a Model, but the code for “accessing” this model will be vastly different, so this is the first thing that has to be clarified.
Regardless of whether it is an ‘entity’ or part of a tileset: The picking functionality that is currently implemented in CesiumJS will not be sufficient for the task at hand. The pickModel function will only provide a cartesian position, but not a surface normal. (Of course, it should provide the normal. Or rather: The triangle, and the barycentric coordinates of the picked point. Everything else can be derived from that). But maybe a “client-side”, custom pickModel function could be implemented, with a bit of copy and paste and tweaking the existing one, so that it also returns the surface normal at the picked position.
(Much of this will currently have to happen on the application side, unless the goal to generalize the pickModel function is tracked in a dedicated issue)
@Marco13 Thank you for the answer. We are useing glb model.to you first answer, this is not related, we are not using Gausian Splats, but models We’re wondering why the Sandcastel works more or less, but our model doesn’t. and the problem is, I can’t place an entity on the roof or wall of the model, it’s like the model is transparent. When I click to choose a position, it selects a spot on the terrain instead of on the model. So we are manually setting heading, pitch, height from the ground to align it with model. Maybe we try with an polygon. But is very hard to find a solution.
Trying to skip some details about the alignment of the object that should be placed, it sounds like the most fundamental issue is
When I click to choose a position, it selects a spot on the terrain instead of on the model.
Is it possible to share this model? (There are some issues related to (model) picking in general, but in principle, it should work, insofar that it should be possible to pick a point on the model)