# Ellipse not showing correctly

**URL:** <https://community.cesium.com/t/ellipse-not-showing-correctly/15445>\
**Category:** CesiumJS\
**Created:** [September 27, 2021, 9:05am UTC](https://community.cesium.com/t/ellipse-not-showing-correctly/15445 "2021-09-27T09:05:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fation](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/fation/32/3458_2.png) [@fation](https://community.cesium.com/u/fation)\
**Post date:** [September 27, 2021, 9:05am UTC](https://community.cesium.com/t/ellipse-not-showing-correctly/15445/1 "2021-09-27T09:05:21Z")

</div>

ellipse:{

```
      semiMinorAxis: 5.0,

      semiMajorAxis: 5.0,

      height: 0,

      material: Color.RED,

      heightReference: HeightReference.CLAMP_TO_GROUND,

    }

```

 ![Screenshot_7](https://global.discourse-cdn.com/cesium/original/2X/f/fe4927b8ce7d7bd97fe008d0b7d3a3a89ce45ab5.png)

---

<div class="post-metadata">

**Author:** ![Rob](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rob/32/5906_2.png) [@Rob](https://community.cesium.com/u/Rob)\
**Post date:** [September 27, 2021, 3:28pm UTC](https://community.cesium.com/t/ellipse-not-showing-correctly/15445/2 "2021-09-27T15:28:17Z")

</div>

That’s interesting. I thought there might have been an issue with the heightReference and height specifications causing the terrain to cover parts of the object… but I can’t replicate the issue.

[Here’s a Sandcastle example](https://sandcastle.cesium.com/#c=xZLBbtswDIZfhfDJBTI6TZsV8NxgaRJsh3QZsnYnA4ViMzE3WTIk2Vk79N2n2N3aZj4O2EUQyf8nqQ9qhIGGaU8GLkHRHmZkuS7xa5sL0yBr45lWTrAikwYn71KVqsb7NrKmhZRcWfLmrguScuyYLIo8D3+mCqDS1me0in/3ngnj/E2oM9waXc5pZ4hs+OZ0NMLzi/PxAM4u8O3oZHBwK1FSDGlw5YcBPU3TCmxttiKjNGhVT4UY2okAlkq+ZqXN9AfbGMZDHA5eVMS3nkopHBkW8nlPLbXBq+XtAvfsiqmsChEOcdwt9ujPx2cYhvJ/z2LUz2JN+X9BsV7M+0gAFMS7wsUwfBWvaUuGVEZ/2nx8ncfZcnr9+e5mdfdhvbr9ND/G2lF80Lq80eER04MkGASJdfeSJt1YgPdcVto4qI0MESNHZSX9W2y0qbPv5DCzrfEgTaKX1iTnBji/7PnwkElhra9saym/8IMHPUkir//LKrXIWe1WDRkp7g+y4nSy7JKImEQ+7Hc6reVGmKPOvwA).

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [September 28, 2021, 12:05am UTC](https://community.cesium.com/t/ellipse-not-showing-correctly/15445/3 "2021-09-28T00:05:53Z")

</div>

There are several reasons this could happen. The most common reason is that you have `viewer.scene.globe.depthTestAgainstTerrain` set to `true` but are not using terrain.

Do you have a terrain provider enabled?

If you have terrain enabled, then the problem is that you are explicitly settings `height` to 0 which tells Cesium to place the ellipse on the ellipsoid, even that would be below the terrain height (or partially below). height is in reference to the ellipsoid, not whatever the ground height is.

So my two recommendations would be:

1. Don’t have `viewer.scene.globe.depthTestAgainstTerrain` set to `true` unless you are using terrain.
2. Don’t set `height` of geometry to 0 explicitly unless you really want to ignore terrain and put it on the ellipsoid.

---

<div class="post-metadata">

**Author:** ![fation](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/fation/32/3458_2.png) [@fation](https://community.cesium.com/u/fation)\
**Post date:** [September 28, 2021, 10:13am UTC](https://community.cesium.com/t/ellipse-not-showing-correctly/15445/4 "2021-09-28T10:13:51Z")

</div>

Thank you 🙂
