Kaynağa Gözat

格网、分别绘制

zhiyuan-007 3 ay önce
ebeveyn
işleme
d7df04b6ee
1 değiştirilmiş dosya ile 11 ekleme ve 11 silme
  1. 11 11
      src/units/threejs/threeCube.js

+ 11 - 11
src/units/threejs/threeCube.js

@@ -4,7 +4,7 @@ export const ThreeCubeClass = {
     constructor(options) {
         this.webgl = options.webgl;
         this.view = options.view;
-        this.Points = options.points;
+        this.points = options.points;
         this.mesh = null;
         this._camera = null;
     },
@@ -88,28 +88,28 @@ export const ThreeCubeClass = {
             );
         };
 
-        this.mesh = new THREE.InstancedMesh(geometry, material, this.Points.length);
+        this.mesh = new THREE.InstancedMesh(geometry, material, this.points.length);
         // 为实例添加颜色属性
-        const instanceColors = new Float32Array(this.Points.length * 3);
+        const instanceColors = new Float32Array(this.points.length * 3);
         const dummy = new THREE.Object3D();
         const color = new THREE.Color();
         let index = 0;
         // debugger
-        // let dataX_CJ = Points.map(point => point.x);
-        // let dataY_CJ = Points.map(point => point.y);
+        // let dataX_CJ = points.map(point => point.x);
+        // let dataY_CJ = points.map(point => point.y);
         //
-        // let dataX_84 = Points.map(point => point.locationPoint.lat);
-        // let dataY_84 = Points.map(point => point.locationPoint.lon);
+        // let dataX_84 = points.map(point => point.locationPoint.lat);
+        // let dataY_84 = points.map(point => point.locationPoint.lon);
         //
         // console.log("dataX_CJ",dataX_CJ)
         // console.log("dataY_CJ",dataY_CJ)
         // console.log("dataX_84",dataX_84)
         // console.log("dataY_84",dataY_84)
         // debugger
-        for(let i = 0; i < this.Points.length; i++){
-            let worldX = this.Points[i].x;
-            let worldY = this.Points[i].y;
-            let worldZ = this.Points[i].z;
+        for(let i = 0; i < this.points.length; i++){
+            let worldX = this.points[i].x;
+            let worldY = this.points[i].y;
+            let worldZ = this.points[i].z;
             let renderPos = [];
             this.webgl.toRenderCoordinates(this.view, [worldX, worldY, worldZ], 0, this.view.spatialReference, renderPos, 0, 1);
             dummy.position.set(renderPos[0], renderPos[1], renderPos[2]);