素材已上傳至https://gitee.com/i1520/echarts3DEarth.git https://github.com/i1520/echarts3DEarthhtml
一、引入js文件及準備素材。js文件及素材下載參照官網 https://echarts.baidu.com/download.htmlgit
<script src="../js/lib/echarts.min.js"></script>
<script src="../js/lib/echarts-gl.min.js"></script>
<script src="../js/lib/world.js"></script>github
所需素材:world.jpg、starfield.jpg、pisa.hdrapp
二、配置optionecharts
option = {
backgroundColor: "#000",
globe:{
baseTexture: "../img/world.jpg",
heightTexture: "../img/world.jpg",
displacementScale: 0.04,
environment: "../img/starfield.jpg",
shading:"realistic",
realisticMaterial: {
roughness: 0.9
},
postEffect: {
enable: true
},
light: {
main: {
intensity: 5,
shadow: true
},
ambientCubemap: {
texture: "../img/pisa.hdr",
diffuseIntensity: 0.2
}
}
}
};dom
三、所有代碼以下:post
效果如圖:url
原文出處:https://www.cnblogs.com/i1520/p/11446394.htmlspa