# Bug: flying to billboard that is clamped to ground goes through Earth

**URL:** <https://community.cesium.com/t/bug-flying-to-billboard-that-is-clamped-to-ground-goes-through-earth/5321>\
**Category:** CesiumJS\
**Created:** [March 24, 2017, 4:12pm UTC](https://community.cesium.com/t/bug-flying-to-billboard-that-is-clamped-to-ground-goes-through-earth/5321 "2017-03-24T16:12:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@Jacob](https://community.cesium.com/u/Jacob)\
**Post date:** [March 24, 2017, 4:12pm UTC](https://community.cesium.com/t/bug-flying-to-billboard-that-is-clamped-to-ground-goes-through-earth/5321/1 "2017-03-24T16:12:12Z")

</div>

If you fly to a billboard that has heightReference set to Cesium.HeightReference.CLAMP\_TO\_GROUND, then you can fly into the Earth and see stars. This does not happen for all locations but is consistently reproducible.

To reproduce, paste the following into a sandcastle and click Run:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var bb;

function home() {

Sandcastle.declare(home);

viewer.camera.flyHome(0);

viewer.entities.removeAll();

}

function addClampedBillboard() {

Sandcastle.declare(addClampedBillboard);

bb = viewer.entities.add({

position : Cesium.Cartesian3.fromDegrees(-71.4001, 41.8204),

billboard :{

image : ‘…/images/Cesium\_Logo\_overlay.png’,

verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

heightReference: Cesium.HeightReference.CLAMP\_TO\_GROUND

}

});

viewer.flyTo(bb);

}

function addUnclampedBillboard() {

Sandcastle.declare(addUnclampedBillboard);

bb = viewer.entities.add({

position : Cesium.Cartesian3.fromDegrees(-71.4001, 41.8204),

billboard :{

image : ‘…/images/Cesium\_Logo\_overlay.png’,

verticalOrigin: Cesium.VerticalOrigin.BOTTOM

}

});

viewer.flyTo(bb);

}

Sandcastle.addToolbarMenu([{

text : ‘Home’,

onselect : function() {

home();

Sandcastle.highlight(home);

}

},{

text : ‘Add clamped billboard’,

onselect : function() {

addClampedBillboard();

Sandcastle.highlight(addClampedBillboard);

}

}, {

text : ‘Add unclamped billboard’,

onselect : function() {

addUnclampedBillboard();

Sandcastle.highlight(addUnclampedBillboard);

}

}]);

Select “Add clamped billboard” and you fly into the Earth. If you Run and select STK terrain before “Add clamped billboard”, you momentarily fly into the Earth and then get repositioned, though the final view does not include the billboard (you need to zoom out a bit to see it).

If you select “Add unclamped billboard”, it seems to work fine for Ellipsoid terrain. If you use STK terrain though, the billboard floats in the air, which is why you’d use CLAMP\_TO\_GROUND.

A similar issue is [https://github.com/AnalyticalGraphicsInc/cesium/issues/4999](https://github.com/AnalyticalGraphicsInc/cesium/issues/4999).

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [March 24, 2017, 6:33pm UTC](https://community.cesium.com/t/bug-flying-to-billboard-that-is-clamped-to-ground-goes-through-earth/5321/2 "2017-03-24T18:33:50Z")

</div>

Thanks for reporting this! This is a known bug and we have a GitHub issue open here: [https://github.com/AnalyticalGraphicsInc/cesium/issues/4327](https://github.com/AnalyticalGraphicsInc/cesium/issues/4327)  
I’ve linked to your forum post so we can notify you when we have a chance to look into it.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Jacob](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@Jacob](https://community.cesium.com/u/Jacob)\
**Post date:** [March 24, 2017, 7:48pm UTC](https://community.cesium.com/t/bug-flying-to-billboard-that-is-clamped-to-ground-goes-through-earth/5321/3 "2017-03-24T19:48:08Z")

</div>

Thanks Hannah!
