Unexpected drawing behaviour when updating from 1.45 to 1.49

1. A concise explanation of the problem you're experiencing.

I've just updated the version of cesium that our web app uses from 1.45 to 1.49. I have some code that draws circles, etc on 3D tile sets that have been generated with context capture. Now the circles don't draw correctly on models and only appear to draw on the ground/base imagery layer.

2. A minimal code example. The co-ordinates are being grabbed from a click event and are drawn in the right place. However they're under the 3D tiles on the base imagery layer instead of on the 3D tiles.

function drawCircle(lat, lon, height) {
    let radius = prompt("Specify the radius of the circle in metres.", "3");
    let color = Cesium.Color.RED.withAlpha(0.5);

    return viewer.entities.add({
        position: Cesium.Cartesian3.fromDegrees(lon, lat, height),
        ellipse: {
            semiMinorAxis: radius,
            semiMajorAxis: radius,
            material: color
        }
    });
}

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

To draw annotations etc on models.

4. The Cesium version you're using, your operating system and browser.

Cesium 1.45 works as expected and Cesium 1.49 has this weird behaviour. I've tried every Cesium version in between and the issues starts happening in 1.46 onwards. I'm using Linux (Ubuntu 18.04) with Chromium 69.0.3497.81.

I think by default the ellipse gets clamped to the ground.

You can pass a height to put it where you’d like, which you can compute from the picked position. Here’s a Sandcastle example.

Let me know if that helps!

Ah that has fixed it. I just explicitly specified the height in the ellipse object.

One other thing, is there a way to get label entities to always draw on top of 3d tiles? If I put a label entity halfway up a structure, and rotate the camera, it goes "inside" the structure and isn't visible.

Cheers!

Nevermind, I should have just looked at the documentation. I found the option “disableDepthTestDistance: Number.POSITIVE_INFINITY” does what I want.

Glad you figured it out, and thanks for posting it back here in case anyone else has the same question!