1. A concise explanation of the problem you’re experiencing.
I would like to have the camera controls respond only when mouse is clicking on a given 3D tileset I added to the scene, and not when mouse is clicking on the globe (default ellipsoid, no terrain provider). See context for why, I basically would like to use the cesium viewer for an asset which is not linked to a geographical context - therefore an asset which is like hanging in the air on a black background, a bit like sketchfab viewer.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
Not a bug, but here is what I tried so far. I’ve tried playing with viewer.scene.globe.depthTestAgainstTerrain = false with no luck. I’ve also seen mentions of depthFailMaterial, but used for polylines and polygons and not the globe directly. Could it be used in my case?
After digging through code and github, here is probably the best bet. I am using default camera controls (through scene.screenSpaceCameraController), which probably perform a test based on z-buffer at mouse coordinate when clicking. The controller is probably calling viewer.scene.pickPosition which in turn calls viewer.scene.globe.pick. What I would like to do is basically prevent globe.pick to return anything so camera controls would only work when mouse is clicking on the 3Dtiles asset, and not on the globe.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I am using the cesium viewer to display a 3D tiles mesh (100M polys tiled with ion) which should not be linked to any geospatial context. So I disabled imagery providers, set terrain to ellipsoid, set sky, atmosphere, world to black, etc. When I use middle mouse button to rotate around the 3D tileset, it works correctly, but I would like to disable it when clicking outside the tileset (on the terrain), which sometimes induce a really large camera motion since the pick point is far from camera center.
4. The Cesium version you’re using, your operating system and browser.
Latset build available, 1.67 (on firefox and chrome, on windows)
Sorry for being not so concise. Best,