disableDepthTestDistance causes weird mouse interaction
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
`disableDepthTestDistance` pushes the billboards to the near plane, which messes up the collision detection when you try to zoom in.
See discussion in https://github.com/AnalyticalGraphicsInc/cesium/pull/6802#issuecomment-405415474
```js
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain()
});
viewer.scene.globe.depthTestAgainstTerrain = true;
var lon = -122.1958;
var lat = 46.1915;
for (var i = 0; i < 20; i++) {
for (var j = 0; j < 20; j++) {
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(lon + i * -0.001, lat + j * -0.001),
billboard : {
image : '../images/facility.gif',
heightReference : Cesium.HeightReference.RELATIVE_TO_GROUND,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance: Number.POSITIVE_INFINITY
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(lon + i * 0.001, lat + j * 0.001),
billboard : {
image : '../images/facility.gif',
heightReference : Cesium.HeightReference.RELATIVE_TO_GROUND,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance: Number.POSITIVE_INFINITY
}
});
}
}
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(lon, lat, 10000)
});
```
Contributor guide
Research direction
Start by reproducing the provided Cesium Viewer example with terrain depth testing and billboards using disableDepthTestDistance set to Number.POSITIVE_INFINITY. Read the linked pull-request discussion and trace billboard depth handling alongside the zoom collision behavior. Done means zooming no longer produces the reported interaction problem, with regression coverage if the relevant test location can be identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100