diff --git a/src/jlmap3d/config/WeatherManager.js b/src/jlmap3d/config/WeatherManager.js index e49c6d76c..a749d0efa 100644 --- a/src/jlmap3d/config/WeatherManager.js +++ b/src/jlmap3d/config/WeatherManager.js @@ -1,20 +1,21 @@ import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; -export function WeatherManager(){ +export function WeatherManager(scene){ let scope = this; let spriteSwitch = false; let spriteSpeed = 0; let spriteRota = 0; - let sunnyTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/sunny.jpg" ); - let eveningTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/evening.jpg" ); - let rainTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/rain.png" ); + let zsTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/zs.jpg" ); + let zwTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/zw.jpg" ); + let bwTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/bw.jpg" ); + let ywTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/yw.jpg" ); let rainPoint = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/sprite/rainsprite.png" ); let snowPoint = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/sprite/snowsprite.png" ); let geometry = new THREE.SphereGeometry( 3000, 32, 32 ); - let material = new THREE.MeshBasicMaterial( {map:sunnyTexture,side:THREE.DoubleSide} ); + let material = new THREE.MeshBasicMaterial( {map:zsTexture,side:THREE.DoubleSide} ); scope.skybox = new THREE.Mesh( geometry, material); scope.skybox.position.set( 0, 0, 0 ); @@ -44,31 +45,80 @@ export function WeatherManager(){ this.changeweather = function(type){ - if(type == "sunny"){ - scope.skybox.material.map = sunnyTexture; + scene.fog = null; + switch (type) { + case 'zaoshang': + scope.skybox.material.map = zsTexture; + break; + case 'zhongwu': + scope.skybox.material.map = zwTexture; + break; + case 'bangwan': + scope.skybox.material.map = bwTexture; + break; + case 'yewan': + scope.skybox.material.map = ywTexture; + break; + + + case 'sunny': spriteSwitch = false; - } - if(type == "evening"){ - scope.skybox.material.map = eveningTexture; + break; + case 'yt': spriteSwitch = false; - } - if(type == "rain"){ - scope.skybox.material.map = rainTexture; + scene.fog = new THREE.Fog(0xE0E0E0, 1000, 3500); + break; + case 'rain': scope.instance.material.map = rainPoint; spriteSwitch = true; spriteSpeed = 0.01; spriteRota = 0; scope.instance.material.size = 0.5; - } - if(type == "snow"){ - scope.skybox.material.map = rainTexture; + scene.fog = new THREE.Fog(0xE0E0E0, 1000, 3500); + break; + case 'snow': scope.instance.material.map = snowPoint; spriteSwitch = true; spriteSpeed = 0.0001; spriteRota = 0.002; scope.instance.material.size = 1.5; + scene.fog = new THREE.Fog(0xE0E0E0, 1000, 3500); + break; + case 'dy': + spriteSwitch = false; + scene.fog = new THREE.Fog(0xE0E0E0, 500, 3000); + break; + case 'sand': + scene.fog = new THREE.Fog(0x977C00, 1, 1000); + break; + case 'wm': + spriteSwitch = false; + scene.fog = new THREE.Fog(0x9D9D9D, 1, 1000); } + + + + + + // + // if(type == "sunny"){ + // scope.skybox.material.map = sunnyTexture; + // spriteSwitch = false; + // } + // if(type == "evening"){ + // scope.skybox.material.map = eveningTexture; + // spriteSwitch = false; + // } + // if(type == "rain"){ + // scope.skybox.material.map = rainTexture; + + // } + // if(type == "snow"){ + // scope.skybox.material.map = rainTexture; + + // } + if(spriteSwitch == true){ if(scope.skybox.children.length == 0){ scope.skybox.add(scope.instance); diff --git a/src/jlmap3d/jl3dsimulation/jlmap3d.js b/src/jlmap3d/jl3dsimulation/jlmap3d.js index c63564ed7..6c24c3216 100644 --- a/src/jlmap3d/jl3dsimulation/jlmap3d.js +++ b/src/jlmap3d/jl3dsimulation/jlmap3d.js @@ -57,7 +57,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { scene.add(scenesimulation); scene.add(scenestation); - let weatherManager = new WeatherManager(); + let weatherManager = new WeatherManager(scene); scene.add(weatherManager.skybox); // scene.add(weatherManager.instance); diff --git a/src/views/jlmap3d/simulation/show/configmenu.vue b/src/views/jlmap3d/simulation/show/configmenu.vue index a4ba647db..3d97d0c28 100644 --- a/src/views/jlmap3d/simulation/show/configmenu.vue +++ b/src/views/jlmap3d/simulation/show/configmenu.vue @@ -59,7 +59,7 @@ export default { pic:JL3D_LOCAL_STATIC+'/sprite/sunny.png', }, { - type:'evening', + type:'yt', pic:JL3D_LOCAL_STATIC+'/sprite/evening.png', }, { @@ -69,6 +69,18 @@ export default { { type:'snow', pic:JL3D_LOCAL_STATIC+'/sprite/snow.png', + }, + { + type:'dy', + pic:JL3D_LOCAL_STATIC+'/sprite/dy.png', + }, + { + type:'sand', + pic:JL3D_LOCAL_STATIC+'/sprite/sand.png', + }, + { + type:'wm', + pic:JL3D_LOCAL_STATIC+'/sprite/wm.png', } ], } diff --git a/static/background/bw.jpg b/static/background/bw.jpg new file mode 100644 index 000000000..c5bbf4317 Binary files /dev/null and b/static/background/bw.jpg differ diff --git a/static/background/evening.jpg b/static/background/evening.jpg deleted file mode 100644 index 770506ba0..000000000 Binary files a/static/background/evening.jpg and /dev/null differ diff --git a/static/background/rain.png b/static/background/rain.png deleted file mode 100644 index 1baf57174..000000000 Binary files a/static/background/rain.png and /dev/null differ diff --git a/static/background/sand.jpg b/static/background/sand.jpg deleted file mode 100644 index 66bca67ca..000000000 Binary files a/static/background/sand.jpg and /dev/null differ diff --git a/static/background/sands.jpg b/static/background/sands.jpg deleted file mode 100644 index 73da58725..000000000 Binary files a/static/background/sands.jpg and /dev/null differ diff --git a/static/background/sunny.jpg b/static/background/sunny.jpg deleted file mode 100644 index e981e3466..000000000 Binary files a/static/background/sunny.jpg and /dev/null differ diff --git a/static/background/yw.jpg b/static/background/yw.jpg new file mode 100644 index 000000000..6046a655c Binary files /dev/null and b/static/background/yw.jpg differ diff --git a/static/background/zs.jpg b/static/background/zs.jpg new file mode 100644 index 000000000..434b438be Binary files /dev/null and b/static/background/zs.jpg differ diff --git a/static/background/zw.jpg b/static/background/zw.jpg new file mode 100644 index 000000000..81f44bb54 Binary files /dev/null and b/static/background/zw.jpg differ diff --git a/static/sprite/多云.png b/static/sprite/dy.png similarity index 100% rename from static/sprite/多云.png rename to static/sprite/dy.png diff --git a/static/sprite/沙尘暴.png b/static/sprite/sand.png similarity index 100% rename from static/sprite/沙尘暴.png rename to static/sprite/sand.png diff --git a/static/sprite/雾霾1(1).png b/static/sprite/wm.png similarity index 100% rename from static/sprite/雾霾1(1).png rename to static/sprite/wm.png