xzw 2 years ago
parent
commit
b5a24d8fab

+ 9 - 7
public/static/lib/potree/potree.js

@@ -75985,11 +75985,11 @@ void main()
 	        this.transformInvMatrix = new Matrix4; 
 	        this.transformInvMatrix = new Matrix4; 
 	        this.rotateInvMatrix = new Matrix4; 
 	        this.rotateInvMatrix = new Matrix4; 
 	        
 	        
-	        
+	        this.material.spacing = this.pcoGeometry.spacing;//初始化一下 以便于设置pointsize
 	        this.nodeMaxLevelPredict = this.predictNodeMaxLevel();//预测maxNodeLevel  
 	        this.nodeMaxLevelPredict = this.predictNodeMaxLevel();//预测maxNodeLevel  
 	        this.testMaxNodeCount = this.testMaxNodeCount2 = 0;
 	        this.testMaxNodeCount = this.testMaxNodeCount2 = 0;
 	        
 	        
-	        this.material.spacing = this.pcoGeometry.spacing;//初始化一下 以便于设置pointsize
+	        
 	        this._visible = true;
 	        this._visible = true;
 	        this.pcoGeometry.addEventListener('updateNodeMaxLevel', this.updateNodeMaxLevel.bind(this));
 	        this.pcoGeometry.addEventListener('updateNodeMaxLevel', this.updateNodeMaxLevel.bind(this));
 	        this.isPointcloud = true;    //add
 	        this.isPointcloud = true;    //add
@@ -76137,12 +76137,13 @@ void main()
 	    //预测可能的nodeMaxLevel:
 	    //预测可能的nodeMaxLevel:
 	     
 	     
 	    predictNodeMaxLevel(){//预测maxNodeLevel。  可能只适用于我们相机拍的点云
 	    predictNodeMaxLevel(){//预测maxNodeLevel。  可能只适用于我们相机拍的点云
-	        let spacing = {min:0.005, max:0.014};//最小节的两点间的距离  ,获得方法:spacing / Math.pow(2, nodeMaxLevel)。 目前观测的我们自己拍的这个数值的范围大概是这样
-	        let min = Math.log2(this.material.spacing / spacing.max); //有见过最大是0.01368 
-	        let max = Math.log2(this.material.spacing / spacing.min); //大部分是 0.006
+	        //let spacing = {min:0.005, max:0.014};//最小节的两点间的距离  ,获得方法:spacing / Math.pow(2, nodeMaxLevel)。 目前观测的我们自己拍的这个数值的范围大概是这样
+	        let spacing = {min:0.006, max:0.0082};   //0.006743906065821648  0.0080347936
+	        let min = Math.log2(this.material.spacing / spacing.max); 
+	        let max = Math.log2(this.material.spacing / spacing.min); 
 	        //console.log('predictNodeMaxLevel:', this.name ,  min, max ) 
 	        //console.log('predictNodeMaxLevel:', this.name ,  min, max ) 
-	    
-	    
+	        
+	        
 	        return {min, max}
 	        return {min, max}
 	    } 
 	    } 
 	    
 	    
@@ -136910,6 +136911,7 @@ ENDSEC
 	                let v = panoMap.get(pano).visible;
 	                let v = panoMap.get(pano).visible;
 	                v && count++;
 	                v && count++;
 	                Potree.Utils.updateVisible(pano.marker, 'limitMarkerShow', v );  
 	                Potree.Utils.updateVisible(pano.marker, 'limitMarkerShow', v );  
+	                
 	            });
 	            });
 	            //console.log('updateMarkerVisibles marker显示个数', count)
 	            //console.log('updateMarkerVisibles marker显示个数', count)
 	        };
 	        };

File diff suppressed because it is too large
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 6 - 2
src/sdk/laser/core/enter.js

@@ -109,13 +109,17 @@ var enter = ({
     let cameraChange = (e) => {
     let cameraChange = (e) => {
         var camera = e.viewport.camera;
         var camera = e.viewport.camera;
         var pos = camera.position;
         var pos = camera.position;
-        if (e.viewport.name == "MainView") {
+         
+        
+        if (e.viewport.name == "MainView") { 
+            let meterPerPixel = viewer.mainViewport.camera.type == 'OrthographicCamera' ? 1 / viewer.mainViewport.camera.zoom : null//原本我设定的每像素代表1米, 然后再除以zoom
+            console.log('meterPerPixel', meterPerPixel)  
             sceneBus.emit("posChange", {
             sceneBus.emit("posChange", {
                 x: pos.x,
                 x: pos.x,
                 y: pos.y,
                 y: pos.y,
                 z: pos.z,
                 z: pos.z,
                 rotate: camera.rotation,
                 rotate: camera.rotation,
-                //dataset: viewer.atDatasets.map((e) => e.dataset_id),
+                meterPerPixel,
             });
             });
         }
         }
     };
     };