I’m interested in allowing the user to “draw” on a mesh object. I thought I saw an example of this implemented in Cesium a while back, but maybe I’m misremembering. Basically the JS would need to do point picking on the mesh and then change the color at the nearest vertex.
Does anyone know of the example scene I’m talking about? Otherwise, any comments on how to implement this / whether it would be easy would be appreciated.
Actually it would probably be a good idea to use sampleTerrainMostDetailed to get the correct height for your positions drawn in any scene mode. The positions from getPickRay/scene.globe.pick won’t have a very accurate height if you were drawing when zoomed out from the globe because it depends on the LOD for the terrain currently loaded.
Yep, using scene.pickEllipsoid will work in all scene modes, but there is a bit of latency in getting the results back from sampleTerrainMostDetailed. That function is asynchronous and returns a promise to the results. Using getPickRay in 3D and CV will give you a position with a decent height estimate while you’re waiting for the more accurate one to be fetched. pickEllipsoid will always return a height of 0. In 2D that doesn’t matter because you can’t see the terrain height anyway.