Quellcode durchsuchen

增加模型配置文件

wuhb vor 1 Jahr
Ursprung
Commit
e9501761fc
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
  1. 4 0
      gltf/gltf.json
  2. 3 1
      src/layout/index.vue

+ 4 - 0
gltf/gltf.json

@@ -0,0 +1,4 @@
+[
+{"name":"单罐", "value":"gun2.gltf"}
+,{"name":"吸咐塔", "value":"xifuta.gltf"}
+]

+ 3 - 1
src/layout/index.vue

@@ -31,7 +31,8 @@
             </el-collapse-item>
             <el-collapse-item title="自定义" name="2">
               <el-row>
-                <el-button style="margin-left: 12px;" type="primary" @click="loadGLB('gun2.gltf')">单罐</el-button>
+                <el-button class="basic-model" v-for="item in gltfJson" :key="item.name" style="margin-left: 12px;" type="primary" @click="loadGLB(item.value)">
+                  {{ item.name }}</el-button>
               </el-row>
             </el-collapse-item>
           </el-collapse>
@@ -53,6 +54,7 @@
   import { ObjectSelect } from '@/utils/objectSelect'
   import { fullscreenToggel } from '@/utils/screen'
   import { getWallData } from '@/stores/data'
+  import gltfJson from '../../gltf/gltf.json'
   import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js';
   import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
   import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';