{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/5333","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/5333/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/5333/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/5333/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/5333","id":229380014,"node_id":"MDU6SXNzdWUyMjkzODAwMTQ=","number":5333,"title":"depthFailMaterial for dynamic polylines","user":{"login":"hpinkos","id":3451886,"node_id":"MDQ6VXNlcjM0NTE4ODY=","avatar_url":"https://avatars3.githubusercontent.com/u/3451886?v=4","gravatar_id":"","url":"https://api.github.com/users/hpinkos","html_url":"https://github.com/hpinkos","followers_url":"https://api.github.com/users/hpinkos/followers","following_url":"https://api.github.com/users/hpinkos/following{/other_user}","gists_url":"https://api.github.com/users/hpinkos/gists{/gist_id}","starred_url":"https://api.github.com/users/hpinkos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpinkos/subscriptions","organizations_url":"https://api.github.com/users/hpinkos/orgs","repos_url":"https://api.github.com/users/hpinkos/repos","events_url":"https://api.github.com/users/hpinkos/events{/privacy}","received_events_url":"https://api.github.com/users/hpinkos/received_events","type":"User","site_admin":false},"labels":[{"id":626675695,"node_id":"MDU6TGFiZWw2MjY2NzU2OTU=","url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels/category%20-%20polyline","name":"category - polyline","color":"bfdadc","default":false},{"id":504228939,"node_id":"MDU6TGFiZWw1MDQyMjg5Mzk=","url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels/onramping","name":"onramping","color":"c2e0c6","default":false},{"id":504229171,"node_id":"MDU6TGFiZWw1MDQyMjkxNzE=","url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels/priority%20-%20high","name":"priority - high","color":"e99695","default":false},{"id":653781,"node_id":"MDU6TGFiZWw2NTM3ODE=","url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels/type%20-%20enhancement","name":"type - enhancement","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-17T14:51:52Z","updated_at":"2018-07-20T15:16:57Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The new `depthFailMaterial` property currently only works for static polyline entities.  This is because the `PolylineGeometryUpdater` uses a `PolylineGeometry` for static polylines and a `PolylineCollection` for dynamic ones.  We'll need to add depth fail material support to the `PolylineCollection`\r\n\r\n``` javascript\r\nvar viewer = new Cesium.Viewer('cesiumContainer');\r\nvar cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({\r\n    url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',\r\n    requestWaterMask : true,\r\n    requestVertexNormals : true\r\n});\r\nviewer.terrainProvider = cesiumTerrainProviderMeshes;\r\nviewer.scene.globe.depthTestAgainstTerrain = true;\r\n\r\nvar length = 1000;\r\n\r\nvar startLon = Cesium.Math.toRadians(86.953793);\r\nvar endLon = Cesium.Math.toRadians(86.896497);\r\n\r\nvar lat = Cesium.Math.toRadians(27.988257);\r\n\r\nvar terrainSamplePositions = [];\r\nfor (var i = 0; i < length; ++i) {\r\n    var lon = Cesium.Math.lerp(endLon, startLon, i / (length - 1));\r\n    var position = new Cesium.Cartographic(lon, lat);\r\n    terrainSamplePositions.push(position);\r\n}\r\n\r\nvar positions = [];\r\nfunction getPositions() {\r\n    return positions;\r\n}\r\nviewer.entities.add({\r\n    polyline : {\r\n        positions : new Cesium.CallbackProperty(getPositions, false),\r\n        followSurface : false,\r\n        width : 5,\r\n        material : new Cesium.PolylineOutlineMaterialProperty({\r\n            color : Cesium.Color.ORANGE,\r\n            outlineWidth : 2,\r\n            outlineColor : Cesium.Color.BLACK\r\n        }),\r\n        depthFailMaterial : new Cesium.PolylineOutlineMaterialProperty({\r\n            color : Cesium.Color.RED,\r\n            outlineWidth : 2,\r\n            outlineColor : Cesium.Color.BLACK\r\n        })\r\n    }\r\n});\r\n\r\nCesium.when(Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, terrainSamplePositions), function(samples) {\r\n    var offset = 10.0;\r\n    for (var i = 0; i < samples.length; ++i) {\r\n        samples[i].height += offset;\r\n    }\r\n    positions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(samples);\r\n\r\n    var target = new Cesium.Cartesian3(300770.50872389384, 5634912.131394585, 2978152.2865545116);\r\n    offset = new Cesium.Cartesian3(6344.974098678562, -793.3419798081741, 2499.9508860763162);\r\n    viewer.camera.lookAt(target, offset);\r\n    viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments/406632233","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/5333#issuecomment-406632233","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/5333","id":406632233,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjYzMjIzMw==","user":{"login":"hpinkos","id":3451886,"node_id":"MDQ6VXNlcjM0NTE4ODY=","avatar_url":"https://avatars3.githubusercontent.com/u/3451886?v=4","gravatar_id":"","url":"https://api.github.com/users/hpinkos","html_url":"https://github.com/hpinkos","followers_url":"https://api.github.com/users/hpinkos/followers","following_url":"https://api.github.com/users/hpinkos/following{/other_user}","gists_url":"https://api.github.com/users/hpinkos/gists{/gist_id}","starred_url":"https://api.github.com/users/hpinkos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpinkos/subscriptions","organizations_url":"https://api.github.com/users/hpinkos/orgs","repos_url":"https://api.github.com/users/hpinkos/repos","events_url":"https://api.github.com/users/hpinkos/events{/privacy}","received_events_url":"https://api.github.com/users/hpinkos/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T15:16:57Z","updated_at":"2018-07-20T15:16:57Z","author_association":"CONTRIBUTOR","body":"Also requested by @dminor112 in #6728 \r\n\r\n@mramato do you think it would make sense to update `DynamicPolylineUpdater` to use a `PolylineGeometry` when `depthFailMaterial` is set?  I'm not sure how soon we'll be able to add support to this for `PolylineCollection`."}}
{"actor":{"display_login":"hpinkos"}}