Browse Source

更新台架

zhangmingyan 6 months ago
parent
commit
e1260f484d
3 changed files with 373 additions and 231 deletions
  1. 180 98
      public/models/mesh2Draco.gltf
  2. 185 126
      public/models/meshDraco.gltf
  3. 8 7
      src/uwb-sample.js

File diff suppressed because it is too large
+ 180 - 98
public/models/mesh2Draco.gltf


File diff suppressed because it is too large
+ 185 - 126
public/models/meshDraco.gltf


+ 8 - 7
src/uwb-sample.js

@@ -214,7 +214,7 @@ function getsqlData(sdkInstance, uwbInstance, bAddModel) {
             if (benchType == 1) {
               var childMesh = gltf.scene.children[0].children[0];
               let childMeshTmp = new THREE.Mesh(childMesh.geometry, childMesh.material);
-              let scale = 5;
+              let scale = 0.08;
               childMeshTmp.scale.set(scale, scale, scale)
               childMeshTmp.position.set(x, y, z)
               var Euler = new THREE.Euler(Math.PI * ang_x, Math.PI * ang_y, Math.PI * ang_z);
@@ -383,7 +383,7 @@ function getsqlData(sdkInstance, uwbInstance, bAddModel) {
         fbxLoader2.load("../models/mesh2Draco.gltf", function (gltf) {
           console.log('22-old', Date.now());
           fbxLoader2Loaded = true;
-          fbxMesh2 = gltf.scene.children[0];
+          fbxMesh2 = gltf.scene.children[0].children[0];
           let benchIdList = window.store.getters['benchList/getBenchList'].map(m => m.id);
           let result = g_PosArrayResult;
           for (var item of result) {
@@ -409,9 +409,10 @@ function getsqlData(sdkInstance, uwbInstance, bAddModel) {
             }
 
             if (benchType == 2) {
-              var childMesh = gltf.scene.children[0];
+              // var childMesh = gltf.scene.children[0];
+              var childMesh = gltf.scene.children[0].children[0];
               let childMeshTmp = new THREE.Mesh(childMesh.geometry, childMesh.material)
-              let scale = 0.05;
+              let scale = 0.03;
               childMeshTmp.scale.set(scale, scale, scale)
               childMeshTmp.position.set(x, y, z)
               var Euler = new THREE.Euler(Math.PI * ang_x, Math.PI * ang_y, Math.PI * ang_z);
@@ -1223,13 +1224,13 @@ function benchRefresh(result) {
           let scale = 1;
           if (benchType == 1) {
             childMeshTmp = new THREE.Mesh(fbxMesh1.geometry, fbxMesh1.material);
-            scale = 5;
+            scale = 0.08;
           } else if (benchType == 2) {
             childMeshTmp = new THREE.Mesh(fbxMesh2.geometry, fbxMesh2.material)
-            scale = 0.05;
+            scale = 0.03;
           } else if (benchType == 3) {
             childMeshTmp = new THREE.Mesh(fbxMesh3.geometry, fbxMesh3.material)
-            scale = 0.05;
+            scale = 0.1;
           } else {
             console.log("未知的台架类型,bench_type=", benchType)
             continue;