Pārlūkot izejas kodu

feat(draw): save

gemer zhang 1 gadu atpakaļ
vecāks
revīzija
78fc317bd3
3 mainītis faili ar 43 papildinājumiem un 154 dzēšanām
  1. 2 2
      src/core/box/BoxManager.js
  2. 4 3
      src/core/box/HorizontalBox.js
  3. 37 149
      src/core/save.json

+ 2 - 2
src/core/box/BoxManager.js

@@ -33,9 +33,9 @@ export default class BoxManager {
         // console.log("竖排");
         this.model.add(box);
       }
-
     });
-
+    // this.model.position.y += 0.3;
+    // this.model.visible =false;
     this.scene.scene.add(this.model);
     console.log("this.scene.scene", this.scene.scene);
   };

+ 4 - 3
src/core/box/HorizontalBox.js

@@ -41,7 +41,8 @@ export default class HorizontalBox extends THREE.Group {
     box.scale.set(this.width, 1, this.height);
 
     this.add(box);
-    this.position.x = (this.width + 0.125) * index;
+    this.position.x = (this.width + 0.125) * index - 2.2;
+
 
     const matLine = new LineMaterial({
       color: 0xe44d54,
@@ -60,12 +61,12 @@ export default class HorizontalBox extends THREE.Group {
       this.manager.loader.load(i.imgUrl, (texture) => {
         let imgRatio = texture.image.width / texture.image.height;
 
-        let planeRatio = 1.5 /  0.85;
+        let planeRatio = 1.5 / 0.85;
         let ratio = planeRatio / imgRatio;
 
         texture.repeat.x = ratio;
         texture.offset.x = 0.5 * (1 - ratio);
-        
+
         // console.log("texture", texture);
         texture.colorSpace = THREE.SRGBColorSpace;
         img = new ImgLabel(texture, matLine);

+ 37 - 149
src/core/save.json

@@ -1,116 +1,60 @@
 {
     "hor_lines": [
         [
-            0.37457214355468404,
+            -1.6917142333984378,
             5,
-            -0.6844542108877344,
-            0.8751436157226529,
+            -0.7278826776845879,
+            -1.1831426391601565,
             5,
-            -0.6844542108877344,
-            0.8751436157226529,
+            -0.7278826776845879,
+            -1.1831426391601565,
             5,
-            -0.7187400995595923,
-            1.375,
+            -0.7873111444814335,
+            -0.8250000000000002,
             5,
-            -0.7187400995595923
+            -0.7873111444814335
         ],
         [
-            0.6077149658203091,
+            -1.6962850341796878,
             5,
-            0.3624029668461173,
-            1.024857727050778,
+            0.4675462773929395,
+            -1.2345708618164064,
             5,
-            0.3624029668461173,
-            1.024857727050778,
+            0.4675462773929395,
+            -1.2345708618164064,
             5,
-            0.37383192192423637,
-            1.375,
+            0.55668909965852,
+            -0.8250000000000002,
             5,
-            0.37383192192423637
+            0.55668909965852
         ],
         [
-            2.6100012207031225,
+            0.4934287109375,
             5,
-            -0.5930254999502802,
-            3.055715576171872,
+            -0.8261686273915703,
+            0.92771435546875,
             5,
-            -0.5930254999502802,
-            3.055715576171872,
+            -0.8261686273915703,
+            0.92771435546875,
             5,
-            -0.746168444286141,
-            3.5,
+            -0.8513112055165577,
+            1.2999999999999998,
             5,
-            -0.746168444286141
+            -0.8513112055165577
         ],
         [
-            2.7014287109374973,
+            -2.004857055664063,
             5,
-            0.4241170781742112,
-            3.115142944335935,
+            -1.1964540888171664,
+            -2.004857055664063,
             5,
-            0.4241170781742112,
-            3.115142944335935,
+            -1.475,
+            1.6340000000000006,
             5,
-            0.3098319219242684,
-            3.5,
+            -1.475,
+            1.6340000000000006,
             5,
-            0.3098319219242684
-        ],
-        [
-            4.749429931640627,
-            5,
-            -0.7255969721181826,
-            5.307144287109377,
-            5,
-            -0.7255969721181826,
-            5.307144287109377,
-            5,
-            0.22068873344775067,
-            5.625,
-            5,
-            0.22068873344775067
-        ],
-        [
-            4.520857421875002,
-            5,
-            0.26640357719772756,
-            5.154000854492189,
-            5,
-            0.26640357719772756,
-            5.154000854492189,
-            5,
-            -0.7278824335439628,
-            5.625,
-            5,
-            -0.7278824335439628
-        ],
-        [
-            6.819491195426028,
-            5,
-            -0.842840401132085,
-            7.436712472459824,
-            5,
-            -0.842840401132085,
-            7.436712472459824,
-            5,
-            -0.7682142811004876,
-            7.75,
-            5,
-            -0.7682142811004876
-        ],
-        [
-            6.950087113058009,
-            5,
-            0.27966222561165854,
-            6.950087113058009,
-            5,
-            -0.12500000000000006,
-            8.588756739629568,
-            5,
-            -0.12500000000000006,
-            8.588756739629568,
-            5,
-            -0.37500000000000006
+            -1.225
         ]
     ],
     "activeEdges": [
@@ -129,32 +73,8 @@
         {
             "id": 12,
             "dir": [
-                1
-            ]
-        },
-        {
-            "id": 7,
-            "dir": [
-                1
-            ]
-        },
-        {
-            "id": 2,
-            "dir": [
-                1
-            ]
-        },
-        {
-            "id": 13,
-            "dir": [
-                1
-            ]
-        },
-        {
-            "id": 1,
-            "dir": [
                 1,
-                2
+                0
             ]
         }
     ],
@@ -163,49 +83,17 @@
         {
             "id": 8,
             "point": [
-                0.2785721435546846,
+                -1.7762850341796879,
                 5,
-                -0.9495972162586956
+                -0.9815972162586799
             ]
         },
         {
             "id": 28,
             "point": [
-                1.6454287109374972,
-                5,
-                -0.7987400995595524
-            ]
-        },
-        {
-            "id": 26,
-            "point": [
-                1.5174287109374966,
-                5,
-                0.300689099658648
-            ]
-        },
-        {
-            "id": 29,
-            "point": [
-                0.31285729980468435,
-                5,
-                0.15668909965872002
-            ]
-        },
-        {
-            "id": 12,
-            "point": [
-                3.6065715332031223,
-                5,
-                -0.9541686273915058
-            ]
-        },
-        {
-            "id": 7,
-            "point": [
-                3.6591433105468725,
+                -0.587714111328125,
                 5,
-                0.11326002251030426
+                -1.0341686273914663
             ]
         }
     ],