{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6995","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6995/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6995/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6995/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/6995","id":356295249,"node_id":"MDU6SXNzdWUzNTYyOTUyNDk=","number":6995,"title":"Expose actualClampedPosition for Points","user":{"login":"OmarShehata","id":1711126,"node_id":"MDQ6VXNlcjE3MTExMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1711126?v=4","gravatar_id":"","url":"https://api.github.com/users/OmarShehata","html_url":"https://github.com/OmarShehata","followers_url":"https://api.github.com/users/OmarShehata/followers","following_url":"https://api.github.com/users/OmarShehata/following{/other_user}","gists_url":"https://api.github.com/users/OmarShehata/gists{/gist_id}","starred_url":"https://api.github.com/users/OmarShehata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmarShehata/subscriptions","organizations_url":"https://api.github.com/users/OmarShehata/orgs","repos_url":"https://api.github.com/users/OmarShehata/repos","events_url":"https://api.github.com/users/OmarShehata/events{/privacy}","received_events_url":"https://api.github.com/users/OmarShehata/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-02T16:26:32Z","updated_at":"2018-09-04T15:11:35Z","closed_at":"2018-09-04T15:11:34Z","author_association":"CONTRIBUTOR","body":"Here's the scenario [which came up on the forum](https://groups.google.com/d/msg/cesium-dev/YsH-gLKVepo/DZp44sZsAgAJ):\r\n\r\nYou're trying to draw a polyline from the air to the ground so it looks something like this:\r\n\r\n![chrome_2018-09-02_12-01-44](https://user-images.githubusercontent.com/1711126/44958083-ec7aa700-aea8-11e8-9015-e7b684bc77ca.png)\r\n\r\nYou can't use polylines clamped to ground because one of the points is in the air. One way to do it is to use `sampleTerrainMostDetailed` to get the actual terrain height and just use that as the other point. \r\n\r\n```\r\n// Plane position\r\nvar position = Cesium.Cartesian3.fromDegrees(-122.0744619, 44.0503706, 1600);\r\nvar groundPosition = new Cesium.Cartographic(-2.1305346621060743, 0.7688285707007808);\r\n\r\nvar promise = Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [groundPosition]);\r\nCesium.when(promise, function(updatedPositions) {\r\n    var finalGroundPos = Cesium.Cartographic.toCartesian(groundPosition);\r\n    viewer.entities.add({\r\n        polyline : {\r\n            positions : [position,finalGroundPos],\r\n            width : 10,\r\n            material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED)\r\n        }\r\n    });\r\n});\r\n```\r\n\r\nBut then this doesn't work well if the point on the ground is moving. So to achieve something like this:\r\n\r\n![ground_line](https://user-images.githubusercontent.com/1711126/44958169-1aacb680-aeaa-11e8-8846-ef20fb6cf81e.gif)\r\n\r\nI created a point that was clamped to ground and used its position as the end point of the line. But that position doesn't take into account the clamping to ground. So I had to dig it out of the private API:\r\n\r\n```\r\nvar PointViz = viewer.dataSourceDisplay._defaultDataSource._visualizers[4];\r\nvar pos = new Cesium.BoundingSphere();\r\n\r\nviewer.entities.add({\r\n    polyline : {\r\n        positions : new Cesium.CallbackProperty(function(time) {\r\n            PointViz.getBoundingSphere(groundPoint,pos);\r\n            return [position, pos.center];\r\n            //return [position, groundPoint.position.getValue(time)];\r\n    }, false),\r\n        width : 10,\r\n        material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED)\r\n    }\r\n});\r\n```\r\n\r\n[Here it is running in Sandcastle](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html#c=jVXbbts4EP0VwS+Rtyot372xG2waF22BZuO1velDHRiMNLaIUqRAUnacRf59h7rYkpsWJfRAzgwPZw4PRzuqnB2DPSjnnSNg79yAZmlM7jObexFkyxspDGUC1IXn/LcSDg4mNvK9fHI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nagUHU2JGpffcmNhJBJC5c/7jJSogpUBfF/).\r\n\r\nIt seems like the Billboard at least does keep track of its actual clamped position:\r\n\r\nhttps://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Billboard.js#L916-L929\r\n\r\nIf it doesn't degrade performance it would be nice to expose this for points (especially if it's already computed every time the point updates). It would be a really easy way/fast way to get terrain height at any location in real time. \r\n\r\n(I tried to look if there was an issue about this already but I couldn't anything. If there's already a way to accomplish this feel free to close). "},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments/418405150","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/6995#issuecomment-418405150","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6995","id":418405150,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODQwNTE1MA==","user":{"login":"cesium-concierge","id":30242416,"node_id":"MDQ6VXNlcjMwMjQyNDE2","avatar_url":"https://avatars2.githubusercontent.com/u/30242416?v=4","gravatar_id":"","url":"https://api.github.com/users/cesium-concierge","html_url":"https://github.com/cesium-concierge","followers_url":"https://api.github.com/users/cesium-concierge/followers","following_url":"https://api.github.com/users/cesium-concierge/following{/other_user}","gists_url":"https://api.github.com/users/cesium-concierge/gists{/gist_id}","starred_url":"https://api.github.com/users/cesium-concierge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesium-concierge/subscriptions","organizations_url":"https://api.github.com/users/cesium-concierge/orgs","repos_url":"https://api.github.com/users/cesium-concierge/repos","events_url":"https://api.github.com/users/cesium-concierge/events{/privacy}","received_events_url":"https://api.github.com/users/cesium-concierge/received_events","type":"User","site_admin":false},"created_at":"2018-09-04T15:11:35Z","updated_at":"2018-09-04T15:11:35Z","author_association":"NONE","body":"Congratulations on closing the issue! I found these Cesium forum links in the comments above:\r\n\r\nhttps://groups.google.com/d/msg/cesium-dev/YsH-gLKVepo/DZp44sZsAgAJ\r\n\r\nIf this issue affects any of these threads, please post a comment like the following:\r\n\r\n> The issue at https://github.com/AnalyticalGraphicsInc/cesium/issues/6995 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.\r\n\n---\n\n__I am a bot who helps you make Cesium awesome! [Contributions to my configuration are welcome.](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/.concierge)__\n\n:earth_africa: :earth_americas: :earth_asia:\n"}}
{"actor":{"display_login":"cesium-concierge"}}