# Funny moment underground

**URL:** <https://community.cesium.com/t/funny-moment-underground/10007>\
**Category:** CesiumJS\
**Created:** [June 25, 2020, 7:05pm UTC](https://community.cesium.com/t/funny-moment-underground/10007 "2020-06-25T19:05:11Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Hyper\_Sonic](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hyper_sonic/32/2255_2.png) [@Hyper\_Sonic](https://community.cesium.com/u/Hyper_Sonic)\
**Post date:** [June 30, 2020, 6:15pm UTC](https://community.cesium.com/t/funny-moment-underground/10007/10 "2020-06-30T18:15:11Z")

</div>

I just noticed that you’ve placed positions parameter (which is already an array) into an array  
`await Cesium.sampleTerrainMostDetailed(terrainProvider, [positions]);`  
does this not work (sans brackets?)  
`await Cesium.sampleTerrainMostDetailed(terrainProvider, positions);`  
where you just need to do res[0].height?

```auto
//determine camera height 
var cp = viewer.scene.camera.position;
camera_height = viewer.scene.globe.ellipsoid.cartesianToCartographic(cp).height;

//determine terrain_height (already did that)

//determine terrain relative height (edist)
var edist = camera_height-terrain_height;

//my unburrow code (modified to exclude stuff specific to my own program)
if(edist<0) //unbury
{
	var GD_transform = Cesium.Transforms.eastNorthUpToFixedFrame(cp, viewer.scene.globe.ellipsoid, new Cesium.Matrix4());
	var GD_ENU_U = new Cesium.Cartesian3(GD_transform[8],GD_transform[9],GD_transform[10]);
	var temp = new Cesium.Cartesian3();
	Cesium.Cartesian3.multiplyByScalar(GD_ENU_U, (terrain_height - camera_height), temp);
	Cesium.Cartesian3.add (map.scene.camera.position, temp, map.scene.camera.position);
}

```

Hmm, code block windows in this discord forum are awfully narrow, perhaps for the sake of smarthphone displays. I suppose scrolling is better than word-wrap which can really make the formatting messy.

---

_[View the full topic](https://community.cesium.com/t/funny-moment-underground/10007)._
