94 lines
2.7 KiB
HTML
94 lines
2.7 KiB
HTML
<!--
|
|
* @Descripttion:
|
|
* @version: 1.0.0
|
|
* @Author: zhangti
|
|
* @Date: 2020-03-05 03:58:30
|
|
* @LastEditors: zhangti
|
|
* @LastEditTime: 2020-07-23 21:55:06
|
|
-->
|
|
<div id="viewer-container"></div>
|
|
<script>
|
|
let viewer = new Cesium.Viewer("viewer-container", {
|
|
shouldAnimate: true,
|
|
useDefaultRenderLoop: true,
|
|
infoBox: false,
|
|
contextOptions: {
|
|
webgl: {
|
|
alpha: false,
|
|
antialias: true,
|
|
preserveDrawingBuffer: true,
|
|
failIfMajorPerformanceCaveat: false,
|
|
depth: true,
|
|
stencil: false,
|
|
anialias: false
|
|
},
|
|
}
|
|
});
|
|
|
|
let d3kit = new Cesium.D3Kit(viewer)
|
|
|
|
let layer = viewer.imageryLayers.addImageryProvider(new Cesium.BaiduImageryProvider({
|
|
style: 'dark'
|
|
}));
|
|
|
|
viewer.scene.skyBox = d3kit.setOneSkyBox()
|
|
|
|
//设置环境光
|
|
viewer.scene.lightSource.ambientLightColor = new Cesium.Color(0.08, 0.08, 0.08, 1);
|
|
|
|
//深度检测
|
|
// this._scene.globe.depthTestAgainstTerrain = false;
|
|
|
|
//地面调节
|
|
//this._scene.globe.baseColor = Cesium.Color.BLACK;
|
|
//this._scene.globe.globeAlpha = 0.1;
|
|
viewer.scene.undergroundMode = true;
|
|
viewer.scene.terrainProvider.isCreateSkirt = false;
|
|
|
|
//调节场景环境
|
|
viewer.scene.sun.show = false;
|
|
viewer.scene.moon.show = false;
|
|
// this._scene.skyBox.show = false;
|
|
viewer.scene.skyAtmosphere.show = false;
|
|
viewer.scene.fxaa = true;
|
|
|
|
//开启颜色校正
|
|
viewer.scene.colorCorrection.show = false;
|
|
viewer.scene.colorCorrection.saturation = 3.1;
|
|
viewer.scene.colorCorrection.brightness = 1.8;
|
|
viewer.scene.colorCorrection.contrast = 1.2;
|
|
viewer.scene.colorCorrection.hue = 0;
|
|
|
|
//开启泛光和HDR
|
|
viewer.scene.bloomEffect.show = false;
|
|
viewer.scene.hdrEnabled = true;
|
|
viewer.scene.bloomEffect.threshold = 1;
|
|
viewer.scene.bloomEffect.bloomIntensity = 2;
|
|
|
|
//最大距离
|
|
viewer.scene.screenSpaceCameraController.maximumZoomDistance = 5000.0
|
|
|
|
var promise = viewer.scene.open('http://www.supermapol.com/realspace/services/3D-CQmodel_wireframe_2000/rest/realspace')
|
|
|
|
Cesium.when.all(promise, (layer) => {
|
|
|
|
d3kit.flyTo({
|
|
position: { x: -1581120.7039257518, y: 5321229.716682734, z: 3142906.4905799916 },
|
|
orientation: {
|
|
heading: Cesium.Math.toRadians(90.10817743123339),
|
|
pitch: Cesium.Math.toRadians(-24.313427860029037),
|
|
roll: Cesium.Math.toRadians(1.9693994587622096e-11)
|
|
}
|
|
})
|
|
layer[0].style3D.emissionColor = new Cesium.Color(2, 5, 10, 1); //自发光颜色
|
|
d3kit.setHypsometric(layer[0])
|
|
|
|
d3kit.createRotateSpotLightGraphics({
|
|
center: Cesium.Cartesian3.fromDegrees(106.5710138566176, 29.516772520652342, 100.0),
|
|
semiMinorAxis: 3000,
|
|
semiMajorAxis: 3000,
|
|
color: new Cesium.Color(20, 15, 15, 0.8)
|
|
})
|
|
|
|
});
|
|
</script> |