# pickPosition  does not work with drillPick?

**URL:** <https://community.cesium.com/t/pickposition-does-not-work-with-drillpick/3019>\
**Category:** CesiumJS\
**Created:** [September 2, 2015, 11:05pm UTC](https://community.cesium.com/t/pickposition-does-not-work-with-drillpick/3019 "2015-09-02T23:05:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wei](https://avatars.discourse-cdn.com/v4/letter/w/90ced4/32.png) [@Wei](https://community.cesium.com/u/Wei)\
**Post date:** [September 2, 2015, 11:05pm UTC](https://community.cesium.com/t/pickposition-does-not-work-with-drillpick/3019/1 "2015-09-02T23:05:39Z")

</div>

I have a model of a house and the polygons on the top of roofs. Since there is another 3d model which is expected to be moved with the mouse on the rooftops (like dragging), I was trying to use drillPick and pickPosition together to make this movement.

However, the picked height sometimes goes beyond the height of the model ( “24.04” in the first figure). The second figure is the one working well (the height is 8.37). Following is my code:

[![](https://lh3.googleusercontent.com/-W57TDeoHwEI/VeeAvd0wScI/AAAAAAAABoQ/n-dNjuR5WrY/s320/1.png)](https://lh3.googleusercontent.com/-W57TDeoHwEI/VeeAvd0wScI/AAAAAAAABoQ/n-dNjuR5WrY/s1600/1.png)

[![](https://lh3.googleusercontent.com/-J4P9Srplq0w/VeeArLVLH7I/AAAAAAAABoI/bpK0OH9rIHk/s320/2.png)](https://lh3.googleusercontent.com/-J4P9Srplq0w/VeeArLVLH7I/AAAAAAAABoI/bpK0OH9rIHk/s1600/2.png)

var ellipsoid = scene.globe.ellipsoid;

// Mouse over the globe to see the cartographic position

var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);

handler.setInputAction(function (movement) {

var foundPosition = false;

var scene = viewer.scene;

var pickedObjects = scene.drillPick(movement.endPosition);

var foundPosition = false;

if (scene.pickPositionSupported && Cesium.defined(pickedObjects)) {

var cartesian = viewer.scene.pickPosition(movement.endPosition);

if (Cesium.defined(cartesian)) {

var cartographic = ellipsoid.cartesianToCartographic(cartesian);

lon = Cesium.Math.toDegrees(cartographic.longitude);

lat = Cesium.Math.toDegrees(cartographic.latitude);

hei = cartographic.height;

labelEntity.position = cartesian;

labelEntity.label.show = true;

labelEntity.label.text = ‘(’ + lon.toFixed(2) + ', ’ + lat.toFixed(2) + ', ’ + hei.toFixed(2) + ‘,’ + ‘)’;

var camera = scene.camera;

labelEntity.label.eyeOffset = new Cesium.Cartesian3(0.0, 0.0, camera.frustum.near \* 1.5 - Cesium.Cartesian3.distance(cartesian, camera.position));

foundPosition = true;

}

}

if (!foundPosition) {

labelEntity.label.show = false;

}

}, Cesium.ScreenSpaceEventType.MOUSE\_MOVE);

``

---

<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:** [September 3, 2015, 6:37pm UTC](https://community.cesium.com/t/pickposition-does-not-work-with-drillpick/3019/2 "2015-09-03T18:37:47Z")

</div>

Hello,

What version of Cesium are you using? A similar problem was fixed a few releases ago.

-Hannah

---

<div class="post-metadata">

**Author:** ![Wei](https://avatars.discourse-cdn.com/v4/letter/w/90ced4/32.png) [@Wei](https://community.cesium.com/u/Wei)\
**Post date:** [September 4, 2015, 11:45pm UTC](https://community.cesium.com/t/pickposition-does-not-work-with-drillpick/3019/3 "2015-09-04T23:45:59Z")

</div>

1.12 version.
