86 lines
2.6 KiB
HTML
86 lines
2.6 KiB
HTML
|
<!--
|
||
|
* @Descripttion:
|
||
|
* @version: 1.0.0
|
||
|
* @Author: zhangti
|
||
|
* @Date: 2020-05-21 22:03:05
|
||
|
* @LastEditors: zhangti
|
||
|
* @LastEditTime: 2020-07-26 18:54:21
|
||
|
-->
|
||
|
<div id="viewer-container"></div>
|
||
|
<script>
|
||
|
let viewer = new Cesium.Viewer("viewer-container", { infoBox: false, shouldAnimate: true });
|
||
|
|
||
|
let d3kit = new Cesium.D3Kit(viewer)
|
||
|
|
||
|
let layer = viewer.imageryLayers.addImageryProvider(new Cesium.BaiduImageryProvider({
|
||
|
style: 'dark'
|
||
|
}));
|
||
|
|
||
|
d3kit.setDefSceneConfig()
|
||
|
d3kit.setBloomLightScene()
|
||
|
var tilesets = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
|
||
|
url: 'data/3DTiles/building/tileset.json'
|
||
|
}));
|
||
|
|
||
|
tilesets.readyPromise.then(function (tileset) {
|
||
|
|
||
|
tileset.style = new Cesium.Cesium3DTileStyle({
|
||
|
color: {
|
||
|
conditions: [
|
||
|
["${height} >= 300", "rgba(0, 149, 251, 0.3)"],
|
||
|
["${height} >= 200", "rgb(0, 149, 251, 0.3)"],
|
||
|
["${height} >= 100", "rgb(0, 149, 251, 0.3)"],
|
||
|
["${height} >= 50", "rgb(0, 149, 251, 0.3)"],
|
||
|
["${height} >= 25", "rgb(0, 149, 251, 0.3)"],
|
||
|
["${height} >= 10", "rgb(0, 149, 251, 0.3)"],
|
||
|
["${height} >= 5", "rgb(0, 149, 251, 0.3)"],
|
||
|
["true", "rgb(0, 149, 251, 0.3)"]
|
||
|
]
|
||
|
}
|
||
|
});
|
||
|
viewer.flyTo(tileset)
|
||
|
|
||
|
let material = d3kit.getCustomMaterialWall({
|
||
|
image: 'data/images/Textures/color3.png',
|
||
|
freely: 'vertical',
|
||
|
direction: '+',
|
||
|
count: 2.0,
|
||
|
color: Cesium.Color.BLUE,
|
||
|
duration: 50000
|
||
|
})
|
||
|
|
||
|
var polygon = d3kit.createPolygonGraphics({
|
||
|
positions: Cesium.Cartesian3.fromDegreesArray([
|
||
|
104.09816110606057, 30.659821965447698,
|
||
|
104.1120972824757, 30.65330300319938,
|
||
|
104.10758419863926, 30.64592470850288,
|
||
|
104.09351691196979, 30.652434826507452,
|
||
|
104.09816110606057, 30.659821965447698,
|
||
|
]),
|
||
|
material: material
|
||
|
})
|
||
|
polygon.polygon.extrudedHeight = 500
|
||
|
|
||
|
//
|
||
|
let material2 = d3kit.getCustomMaterialWall({
|
||
|
image: 'data/images/Textures/gradual_change_red_02.png',
|
||
|
freely: 'vertical',
|
||
|
direction: '+',
|
||
|
count: 2.0,
|
||
|
color: Cesium.Color.BLUE.withAlpha(0.5),
|
||
|
duration: 20000
|
||
|
})
|
||
|
|
||
|
var polygon2 = d3kit.createPolygonGraphics({
|
||
|
positions: Cesium.Cartesian3.fromDegreesArray([
|
||
|
104.07263175401185, 30.647622150198725,
|
||
|
104.06369117158526, 30.648834374000277,
|
||
|
104.06437182811021, 30.62274533905387,
|
||
|
104.07463538167119, 30.62285687644371,
|
||
|
104.07263175401185, 30.647622150198725,
|
||
|
]),
|
||
|
material: material2
|
||
|
})
|
||
|
polygon2.polygon.extrudedHeight = 500
|
||
|
});
|
||
|
</script>
|