dedsudiyu 2 年之前
父節點
當前提交
a6c51c0bbd
共有 1 個文件被更改,包括 19 次插入5 次删除
  1. 19 5
      src/views/newEvacuationBigDataHome.vue

+ 19 - 5
src/views/newEvacuationBigDataHome.vue

@@ -137,6 +137,7 @@
           x:null,//镜头位置
           x:null,//镜头位置
           y:null,//镜头位置
           y:null,//镜头位置
           spacing:300,
           spacing:300,
+          visualDistance:null,
           planColor:'#f15b6c'
           planColor:'#f15b6c'
         },
         },
         //数据类型1.实验室
         //数据类型1.实验室
@@ -296,7 +297,21 @@
         this.$set(this.foundation,'y',maxWidth);
         this.$set(this.foundation,'y',maxWidth);
         //根据楼层宽度或高度来设定每层之间的间距
         //根据楼层宽度或高度来设定每层之间的间距
         // this.$set(this.foundation,'spacing',minWidth>minHeight?minHeight:minWidth);
         // this.$set(this.foundation,'spacing',minWidth>minHeight?minHeight:minWidth);
-        // this.$set(this.foundation,'spacing',maxWidth>maxHeight?maxHeight*0.8:maxWidth*0.8);
+        if(maxWidth>maxHeight){
+          if(maxWidth>1120){
+            maxWidth/1120
+          }else{
+
+          }
+        }else{
+          if(maxHeight>1120){
+
+          }else{
+
+          }
+        }
+        this.$set(this.foundation,'spacing',maxWidth>maxHeight?maxHeight*0.8:maxWidth*0.8);
+        this.$set(this.foundation,'visualDistance',maxWidth>maxHeight?maxWidth*0.8:maxHeight*0.8);
         /*
         /*
          * 创建场景对象Scene
          * 创建场景对象Scene
          */
          */
@@ -503,8 +518,8 @@
         this.camera = new Three.PerspectiveCamera(75, this.container.clientWidth / this.container.clientHeight, 0.1, 3000)
         this.camera = new Three.PerspectiveCamera(75, this.container.clientWidth / this.container.clientHeight, 0.1, 3000)
         //根据楼层间距与显示层数设定相机距离
         //根据楼层间距与显示层数设定相机距离
         this.camera.position.set(0,
         this.camera.position.set(0,
-          this.foundation.spacing*(this.mapList.length),
-          this.foundation.spacing*(this.mapList.length))
+          this.foundation.visualDistance*1.2,
+          this.foundation.visualDistance*1.2)
         /*
         /*
          * 创建渲染器对象
          * 创建渲染器对象
          */
          */
@@ -545,7 +560,7 @@
         let t1 = new Date(); //本次时间
         let t1 = new Date(); //本次时间
         let t = t1 - t0; // 时间差
         let t = t1 - t0; // 时间差
         this.camera.rotateY(0.0001 * t / 3); //物体的均匀从左到又平移可以用相机旋转Y轴来实现
         this.camera.rotateY(0.0001 * t / 3); //物体的均匀从左到又平移可以用相机旋转Y轴来实现
-        this.controls.target = new Three.Vector3(0,this.foundation.spacing*(this.mapList.length-2),0);
+        this.controls.target = new Three.Vector3(0,((this.foundation.visualDistance/20)*this.maxMapButtonList.length),0);
         this.renderer.render(this.scene, this.camera);
         this.renderer.render(this.scene, this.camera);
         this.animateData = requestAnimationFrame(this.animate);
         this.animateData = requestAnimationFrame(this.animate);
       },
       },
@@ -1375,7 +1390,6 @@
       #container{
       #container{
         flex:1;
         flex:1;
         background: rgba(0,0,0,0)!important;
         background: rgba(0,0,0,0)!important;
-        margin-bottom:200px;
       }
       }
       .position-floor-user-box{
       .position-floor-user-box{
         position: absolute;
         position: absolute;