This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const viewer = new Cesium.Viewer("cesiumContainer"); | |
| const primitives = viewer.scene.primitives; | |
| const fs = `czm_material czm_getMaterial(czm_materialInput materialInput) { | |
| czm_material m = czm_getDefaultMaterial(materialInput); | |
| float side = dot(materialInput.positionToEyeEC, materialInput.normalEC); | |
| m.alpha = side > 0.0 ? 0.9 : 0.4; | |
| m.diffuse = side > 0.0 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const viewer = new Cesium.Viewer("cesiumContainer"); | |
| viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({ | |
| url: 'http://wprd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=2&scl=1&style=7', | |
| subdomains: '1234', | |
| tileWidth: 512, | |
| tileHeight: 512, | |
| })); | |
| viewer.resolutionScale = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const clamp = (val: number, min = 0, max = 1) => { | |
| return val > min ? val > max ? max : val : min | |
| } | |
| export const getCesiumScale = (distanceToCamera: number, nearFarScalar: NearFarScalar) => { | |
| const nearScalar = nearFarScalar.nearValue | |
| const farScalar = nearFarScalar.farValue | |
| const nearDistance = nearFarScalar.near | |
| const farDistance = nearFarScalar.far |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://localhost/cedoc/Apps/Sandcastle/index.html#c=nVXbbts4EP2VgV8qAw7tXAosHMdomqZFgMYu2mxRYF20lETZRChS4MWRW/jfd0hZN9f7si82Z+acw+FoOEyUNBa2nL0wDTcg2QvcMcNdTr4GX7QaJMG+U9JSLpleDYbXK5kEnkmYZEir+CSYGKzD3v2oUiYQ8nslAcopTEYruQ+Ywz7PUiXPylliNU2eo4Yz7AhZpURMfYKpSlzOpCVrZu8F88u3u4cU0zxgqvSOtWlRiN1bLlMu16bdY1QrdzdLnLEq/7KhaSjJTyd5pnQOW5ZcQaKE0gjuOZXdMH13FMmEohbKSvhX/iOnlmlOBXgDs3882FE3+CALZ6FnDVcy1A6gp9IsbmrBdyyjTrS6fZXrSgPzvQA85E1/E2JsC8ADORuO48UPx/IxnkFkLClhDuUQDllBF92rhI/tq796M5LyLHPG90zNInodXx+hqCg2tIuhB4Rm1mnZANG7/xkqPB7DJyV2AjsUls76//p7+hKFziSF5jm3fMsMoSn2DEp2Gv5THY0OJ1szlTOrdw+oQiVeg2kX/uEoGjX1qHk9eJ1dTWvhAFQnT7uCTWvsbWWTxXJxP2phhTKYH56pAd5RbXFF5SXJtMrfsbVmzNxqTXfRPy0R4Oz8YkImo67r8thx9tf/gFy87jm+DzvGC0/tZnqssmWYc/kerwi10+Pq1M17WxSMal9W8vX+89P9tx/vl58fb58anX29UbOgDeVk3f9Ubr9A3U49YnOPOh8qo7HmyRR+d0twuPDmyA3V1elphmaOzrEeMCGv/c/VCNAcjvrM9hqdoE8q+lXgT07y/Zwllz3nvmcZ5bQvVHfWdQD7/6zzHsfR8NT49kE/lJexYXpLY8G6Y3Y1KHEwB4xxsUk0j1mUOZn4foaonSYlXtaFy2N8ecphZ+xws6ALdHXGTjUL+nNGkLYNSDNO6i9EvHp5XZ0D/wajwczYnWDzWvMNzwulLTgtI |
OlderNewer