Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Billboard clamp to ground cleanup #6844

Merged
merged 2 commits into from
Jul 30, 2018
Merged

Billboard clamp to ground cleanup #6844

merged 2 commits into from
Jul 30, 2018

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Jul 25, 2018

Cleanup from #6802

  • Default disableDepthTestDistance to undefined instead of 0.0 so user can explicitly override the distance used for the clamp to ground depth testing with 0.0
  • Fix bug with clamped to ground billboards and translucencyByDistance
  • Fix flickering with top down view
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.CLAMP_TO_GROUND,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM
            }
        });
        
        viewer.entities.add({
            position : Cesium.Cartesian3.fromDegrees(lon + i * 0.001, lat + j * 0.001),
            billboard : {
                image : '../images/facility.gif',
                heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM
            }
        });
    }
}

viewer.camera.flyTo({
    destination: Cesium.Cartesian3.fromDegrees(lon, lat, 10000)
});

@cesium-concierge
Copy link

cesium-concierge commented Jul 25, 2018

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@hpinkos
Copy link
Contributor Author

hpinkos commented Jul 27, 2018

@bagnell can you review please?

@bagnell bagnell merged commit 13816d6 into master Jul 30, 2018
@bagnell bagnell deleted the billboard-fixes branch July 30, 2018 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants