From 1cd2fd370b15922135ae364944efd852b8768c65 Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Wed, 22 Apr 2020 13:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E5=8E=9F=E4=B8=89=E7=BB=B4=E6=B2=99?= =?UTF-8?q?=E7=9B=98=E8=A1=8C=E8=BD=A6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/jl3ddrive/jl3ddrive.js | 6 +++--- src/jlmap3d/jl3dsimulation/jlmap3d.js | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/jlmap3d/jl3ddrive/jl3ddrive.js b/src/jlmap3d/jl3ddrive/jl3ddrive.js index 2af26708b..e9552f250 100644 --- a/src/jlmap3d/jl3ddrive/jl3ddrive.js +++ b/src/jlmap3d/jl3ddrive/jl3ddrive.js @@ -140,10 +140,10 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj // controls3.getObject().rotation.x = Math.PI/2; scene.add(controls3.getObject()); - let cameracctv = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 40); - cameracctv.position.set( 2, -1,27 ); + let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 1, 10); + cameracctv.position.set( 0, -1,30 ); - cameracctv.rotation.y = Math.PI/2; + // cameracctv.rotation.y = Math.PI/2; camera.add(cameracctv); diff --git a/src/jlmap3d/jl3dsimulation/jlmap3d.js b/src/jlmap3d/jl3dsimulation/jlmap3d.js index e46cdca2d..ffac70487 100644 --- a/src/jlmap3d/jl3dsimulation/jlmap3d.js +++ b/src/jlmap3d/jl3dsimulation/jlmap3d.js @@ -53,6 +53,8 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { let camera = SetCamera(dom); //定义场景(渲染容器) let scene = SetScene(project); + let scenesimulation = new THREE.Group(); + scene.add(scenesimulation); //定义镜头操作 let controls = new THREE.OrbitControls(camera); controls.maxPolarAngle = Math.PI/2; @@ -110,14 +112,14 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js"); scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); scope.Subscribe.socketon(scope.Subscribe.topic); - SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod); + SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); }else{ scope.datatype = "new"; scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js"); scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew); scope.Subscribe.socketon(scope.Subscribe.topic); - SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod); + SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); } }); @@ -187,12 +189,12 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { scope.webwork.onmessage = function (event) { //更新列车位置 - // if(scope.datatype == "new"){ - // - // UpdateTrainNew(camera,trainlisttest); - // }else{ - // UpdateTrain(camera,trainlisttest); - // } + if(scope.datatype == "new"){ + + UpdateTrainNew(camera,trainlisttest); + }else{ + UpdateTrain(camera,trainlisttest); + } if(camerarail.moveswitch == true){ // console.log(camerarail.progress);