fl-web-component 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "fl-web-component",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "scripts": {
5
5
  "dev": "vue-cli-service serve",
6
6
  "lint": "eslint \"{src,packages}/**/*.{vue,js}\" --fix",
7
7
  "prettier": "prettier --write \"packages/**/*.{js,css,less,scss,vue,html}\"",
8
8
  "watch": "npm run lint && vue-cli-service build --watch --mode production --target lib --name fl-web-component ./src/main.js",
9
- "build": "npm run lint && vue-cli-service build --target lib --name fl-web-component ./src/main.js"
9
+ "build": "npm run lint && vue-cli-service build --target lib --name fl-web-component ./src/main.js",
10
+ "publish": "npm run build && npm publish"
10
11
  },
11
12
  "files": [
12
13
  "dist",
@@ -20,6 +20,8 @@
20
20
  pointControls,
21
21
  threeMeasure,
22
22
  modelGroup,
23
+ gui,
24
+ animateId
23
25
  ] = (function* (v) {
24
26
  while (true) yield v;
25
27
  })(null);
@@ -45,22 +47,26 @@
45
47
  while (true) yield v;
46
48
  })(true);
47
49
 
48
- var clippingPlanes = [];
50
+ var clippingMesh = [];
49
51
  var removeSpeed = 200,
50
52
  upSpeed = 200; //控制器移动速度 , //控制跳起时的速度
51
- var modelGroup;
52
- var roamConfig = {
53
- loop: false,
54
- speed: 0, // 最大值为3
55
- name: ''
56
- }
53
+ var roamConfig = {
54
+ loop: false,
55
+ speed: 0, // 最大值为3
56
+ name: ''
57
+ }
58
+ var guiParams = {
59
+ 'x轴': 0,
60
+ 'y轴': 0,
61
+ 'z轴': 0,
62
+ }
57
63
  // 绘制对象映射实例表
58
- let drawObjMapInstance = {};
59
64
  import CameraControls from 'camera-controls';
60
65
  import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';
61
66
  import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
62
67
  import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
63
68
  import { PointerLockControls } from 'three/examples/jsm/controls/PointerLockControls.js';
69
+ import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js'
64
70
  import MeasureDistance from '@/utils/threejs/measure-distance.js';
65
71
  import MeasureArea from '@/utils/threejs/measure-area.js';
66
72
  import MeasureAngle from '@/utils/threejs/measure-angle.js';
@@ -165,22 +171,66 @@ var roamConfig = {
165
171
  /*
166
172
  参数:data 模型数据
167
173
  color: '' 初始化模型的颜色 在业务方 有这个需求
168
- meshNameConfig: {}
174
+ meshNameConfig: {}
169
175
  */
170
- drawModel(data, color = '', meshNameConfig) {
176
+ drawModel(data, color = '', meshNameConfig = {}) {
171
177
  if (Object.keys(data).length === 0) {
172
178
  return;
173
179
  }
174
180
  const { instances, drawObjs } = parseData(data);
175
181
  if (instances.length > 0) {
176
182
  modelGroup = handleInstancedMeshModel(instances, drawObjs, '', scene, color, meshNameConfig);
183
+ let modelBox3 = new this.THREE.Box3();
184
+ modelBox3.expandByObject(modelGroup);
185
+ let modelWorldPs = new this.THREE.Vector3().addVectors(modelBox3.max, modelBox3.min).multiplyScalar(0.5)
177
186
  scene.add(modelGroup);
187
+ modelGroup.traverse(child => {
188
+ if (child.isMesh) {
189
+ const json = this.getMeshCenterAndVolume(child)
190
+ let meshBox3 = new this.THREE.Box3();
191
+ meshBox3.setFromObject(child);
192
+ // 获取每个mesh的中心点,爆炸方向为爆炸中心点指向mesh中心点
193
+ let worldPs = new this.THREE.Vector3().addVectors(meshBox3.max, meshBox3.min).multiplyScalar(0.5)
194
+ if (isNaN(worldPs.x)) return
195
+ // 计算爆炸方向
196
+ child.worldDir = new this.THREE.Vector3().subVectors(worldPs, modelWorldPs).normalize()
197
+ // 保存初始坐标
198
+ child.userData.center = json.center
199
+ child.userData.worldPs = worldPs
200
+ child.userData.oldPs = child.getWorldPosition(new this.THREE.Vector3())
201
+ child.userData.box = json.box
202
+ child.userData.position = new this.THREE.Vector3().copy(child.position)
203
+ child.userData.translate = {
204
+ x: 0,
205
+ y: 0,
206
+ z: 0
207
+ }
208
+ child.userData.rotate = {
209
+ x: 0,
210
+ y: 0,
211
+ z: 0
212
+ }
213
+ child.userData.modelWorldPs = modelWorldPs
214
+ }
215
+ })
178
216
  // this.compileShader();
179
217
  // cameraControls.fitToSphere(scene, true); // TODO 待处理,先用 setModelCenter 进行定位
180
218
  this.setModelCenter(modelGroup);
181
219
  // cameraControls.saveState();
182
220
  }
183
221
  },
222
+ // 获取mesh的中心点
223
+ getMeshCenterAndVolume(mesh) {
224
+ const box = new this.THREE.Box3().setFromObject(mesh)
225
+ const volume = box.getSize(new this.THREE.Vector3())
226
+ const geometry = mesh.geometry
227
+ geometry.computeBoundingBox()
228
+ const center = geometry.boundingBox.getCenter(new this.THREE.Vector3())
229
+ return {
230
+ 'center': center,
231
+ 'box': volume
232
+ }
233
+ },
184
234
  compileShader() {
185
235
  scene.traverse(child => {
186
236
  if (child.isMesh) {
@@ -348,8 +398,14 @@ var roamConfig = {
348
398
  case 'visible':
349
399
  targetObj.forEach(children => {
350
400
  const index = children.userData.instanceIndex;
351
- children.geometry.attributes.visible.array[index] = ele.attr[key] ? 1.0 : 0.0;
352
- children.geometry.attributes.visible.needsUpdate = true;
401
+ if (ele.attr[key]) {
402
+ const restoreMatrix = new this.THREE.Matrix4().copy(children.userData.copyMatrix);
403
+ children.setMatrixAt(index, restoreMatrix);
404
+ } else {
405
+ const offsetMatrix = new this.THREE.Matrix4().copy(children.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
406
+ children.setMatrixAt(index, offsetMatrix);
407
+ }
408
+ children.instanceMatrix.needsUpdate = true;
353
409
  });
354
410
  break;
355
411
  case 'opacity':
@@ -366,7 +422,7 @@ var roamConfig = {
366
422
  // obj.material.needsUpdate = true;
367
423
  }
368
424
  },
369
- // 修改整体模型实体的属性
425
+ // 修改整个场景中模型实体的属性
370
426
  /*
371
427
  {
372
428
  attr: '', 需要修改属性名(color、visible(true / false)、opacity(0-1),
@@ -379,7 +435,8 @@ var roamConfig = {
379
435
  if (obj instanceof this.THREE.Mesh) {
380
436
  switch (params.attr) {
381
437
  case 'color':
382
- obj.material.color = new this.THREE.Color(params.value);
438
+ obj.setColorAt(obj.userData.instanceIndex, new this.THREE.Color(params.value));
439
+ obj.instanceColor.needsUpdate = true;
383
440
  break;
384
441
  case 'visible':
385
442
  obj.material.visible = params.value;
@@ -413,20 +470,63 @@ var roamConfig = {
413
470
  }
414
471
  });
415
472
  break;
473
+ case 'visible':
474
+ obj.forEach(children => {
475
+ const index = children.userData.instanceIndex;
476
+ const restoreMatrix = new this.THREE.Matrix4().copy(children.userData.copyMatrix);
477
+ children.setMatrixAt(index, restoreMatrix);
478
+ children.instanceMatrix.needsUpdate = true
479
+ });
480
+ break;
416
481
  }
417
482
  }
418
483
  }
419
484
  }
420
485
  },
421
486
  // 定位到模型
422
- locateModel(id) {
423
- let obj = scene.getObjectByName(id);
487
+ locateModel(name) {
488
+ let obj = scene.getObjectByName(name);
424
489
  if (obj) {
425
490
  // cameraControls.fitToSphere(obj.parent, true); // TODO 待处理,先用 setModelCenter 进行定位
426
491
  this.setModelCenter(obj.parent);
427
492
  // cameraControls.fitToBox( obj, true);
428
493
  }
429
494
  },
495
+ // 根据自定义参数修改模型
496
+ /*
497
+ 自定义参数指的是在调用drawModel时配置的meshNameConfig里面的字段来修改某一类模型实体的属性
498
+ {
499
+ customName: '', 自定义字段名称
500
+ customValue: '' 自定义字段的值
501
+ attr: {
502
+ color: '',
503
+ opacity: 0 -1,
504
+ visiable: true/false
505
+ }
506
+ }
507
+ */
508
+ updatePropertyByCustom(params) {
509
+ scene.traverse(child => {
510
+ if (child.isMesh && child.userData[params.customName] === params.customValue) {
511
+ for (const key in params.attr) {
512
+ switch (key) {
513
+ case 'color':
514
+ child.setColorAt(obj.userData.instanceIndex, new this.THREE.Color(params.attr[key]));
515
+ child.instanceColor.needsUpdate = true;
516
+ break;
517
+ case 'visible':
518
+ child.material.visible = params.attr[key];
519
+ break;
520
+ case 'opacity':
521
+ child.material.opacity = params.attr[key];
522
+ child.material.transparent = true;
523
+ break;
524
+ }
525
+ child.material.needsUpdate = true;
526
+ }
527
+ }
528
+ })
529
+ },
430
530
  // 相机定位
431
531
  /*
432
532
  定位参数:x: 相机的x位置, y: 相机的y位置, z: 相机的z位置
@@ -621,7 +721,7 @@ var roamConfig = {
621
721
  path: params.path,
622
722
  });
623
723
  roaming = true
624
- clock = new this.THREE.Clock();
724
+ // clock = new this.THREE.Clock();
625
725
  },
626
726
  // 更新漫游的配置
627
727
  /*
@@ -629,14 +729,14 @@ var roamConfig = {
629
729
  */
630
730
  updateRoamConfig(params) {
631
731
  for (let key in params) {
632
- roamConfig[key] = key === 'speed' ? params[key] / 300 : params[key]
732
+ roamConfig[key] = params[key]
633
733
  }
634
734
  },
635
735
  // 结束/退出漫游
636
736
  endRoam() {
637
737
  roaming = false;
638
738
  progress = 0;
639
- this.removeObjectByName(this.roamConfig.name);
739
+ this.removeObjectByName(roamConfig.name);
640
740
  roamConfig = {
641
741
  loop: false,
642
742
  speed: 0,
@@ -685,7 +785,7 @@ var roamConfig = {
685
785
  this.computedBomb(item, val);
686
786
  });
687
787
  }
688
- this.timeRender();
788
+ // this.timeRender();
689
789
  },
690
790
  // 单个实体模型炸开
691
791
  /*
@@ -711,7 +811,7 @@ var roamConfig = {
711
811
  先开启模型全局剖切模式, 会返回剖切值的最大最小值
712
812
  剖切值变换时, 使用
713
813
  */
714
- setGlobalClipping() {
814
+ setGlobalClipping(flag = true) {
715
815
  const box3 = new this.THREE.Box3().setFromObject(scene.children[0]);
716
816
  let max = box3.max;
717
817
  let min = box3.min;
@@ -721,6 +821,18 @@ var roamConfig = {
721
821
  new this.THREE.Plane(new this.THREE.Vector3(0, 0, -1), max.z),
722
822
  ];
723
823
  renderer.clippingPlanes = clippingPlanes;
824
+ if (flag) {
825
+ guiParams = {
826
+ 'x轴': clippingPlanes[0].constant,
827
+ 'y轴': clippingPlanes[2].constant,
828
+ 'z轴': clippingPlanes[1].constant
829
+ }
830
+ this.addClippingGui('全局剖切', {
831
+ x: min.x,
832
+ y: min.z,
833
+ z: min.y
834
+ }, clippingPlanes)
835
+ }
724
836
  return {
725
837
  min: min,
726
838
  max: max,
@@ -744,15 +856,23 @@ var roamConfig = {
744
856
  },
745
857
  // 取消全局剖切
746
858
  cancelGlobalClipping() {
859
+ guiParams = {
860
+ 'x轴': 0,
861
+ 'y轴': 0,
862
+ 'z轴': 0
863
+ };
747
864
  renderer.clippingPlanes = Object.freeze([]);
865
+ gui && gui.destroy();
748
866
  },
749
- // 单个实体的剖切/ 局部剖切 obj 实体对象
750
- setLocalClipping(obj) {
867
+ // 单个实体的剖切/ 局部剖切 obj 实体对象 flag 代表是否使用图形组件自带的剖切面板 默认为true
868
+ setLocalClipping(obj, flag = true) {
869
+ clippingMesh.splice(0)
870
+ clippingMesh.push(obj)
751
871
  renderer.localClippingEnabled = true;
752
872
  // mesh的boundingBox 可以获取到该对象位置的最大最小值 但是在这里我们需要把y、z轴互换
753
- const boundingBox = new this.THREE.Box3().copy(obj.geometry.boundingBox);
873
+ const boundingBox = new this.THREE.Box3().copy(obj.boundingBox);
754
874
  boundingBox.applyMatrix4(obj.matrixWorld);
755
- clippingPlanes = [
875
+ let clippingPlanes = [
756
876
  new this.THREE.Plane(new this.THREE.Vector3(-1, 0, 0), Math.ceil(boundingBox.max.x)),
757
877
  new this.THREE.Plane(new this.THREE.Vector3(0, -1, 0), Math.ceil(boundingBox.max.y)),
758
878
  new this.THREE.Plane(new this.THREE.Vector3(0, 0, -1), Math.ceil(boundingBox.max.z)),
@@ -760,6 +880,23 @@ var roamConfig = {
760
880
  obj.material.clippingPlanes = clippingPlanes;
761
881
  obj.material.needsUpdate = true;
762
882
  // 将局部剖切的对象记录下来
883
+ if (flag) {
884
+ guiParams = {
885
+ 'x轴': clippingPlanes[0].constant,
886
+ 'y轴': clippingPlanes[2].constant,
887
+ 'z轴': clippingPlanes[1].constant
888
+ }
889
+ this.addClippingGui('局部剖切', {
890
+ x: Math.floor(boundingBox.min.x),
891
+ y: Math.floor(boundingBox.min.z),
892
+ z: Math.floor(boundingBox.min.y)
893
+ }, obj.material.clippingPlanes)
894
+ // cube.material.clippingPlanes
895
+ };
896
+ return {
897
+ min: boundingBox.min,
898
+ max: boundingBox.max,
899
+ }
763
900
  },
764
901
  // 更新局部剖切的值
765
902
  /*
@@ -772,14 +909,43 @@ var roamConfig = {
772
909
  y: 1,
773
910
  z: 2,
774
911
  };
912
+ let obj = clippingMesh[clippingMesh.length - 1]
775
913
  for (const key in params) {
776
- clippingPlanes[axis[key]].constant = params[key];
914
+ obj.material.clippingPlanes[axis[key]].constant = params[key];
915
+ obj.material.needsUpdate = true;
777
916
  }
778
917
  // this.timeRender()
779
918
  },
780
919
  // 取消局部/单个实体的剖切
781
920
  cancelLocalClipping() {
782
- clippingPlanes = Object.freeze([]);
921
+ guiParams = {
922
+ 'x轴': 0,
923
+ 'y轴': 0,
924
+ 'z轴': 0
925
+ };
926
+ gui && gui.destroy();
927
+ clippingMesh.forEach(item => {
928
+ item.material.clippingPlanes = Object.freeze([])
929
+ item.material.needsUpdate = true
930
+ })
931
+ clippingMesh.splice(0)
932
+ },
933
+ // 添加剖切轴工具
934
+ addClippingGui(title, minValue, objClipp1, objClipp2) {
935
+ gui = new GUI({
936
+ title: title
937
+ })
938
+ gui.add(guiParams, 'x轴').min(minValue.x).max(Math.abs(guiParams['x轴'])).onChange(d => {
939
+ objClipp1[0].constant = d
940
+ objClipp2 && (objClipp2[0].constant = d)
941
+ })
942
+ gui.add(guiParams, 'y轴').min(minValue.y).max(Math.abs(guiParams['y轴'])).onChange(d => {
943
+ objClipp1[2].constant = d
944
+ objClipp2 && (objClipp2[2].constant = d)
945
+ })
946
+ gui.add(guiParams, 'z轴').min(minValue.z).max(Math.abs(guiParams['z轴'])).onChange(d => {
947
+ objClipp1[1].constant = d
948
+ })
783
949
  },
784
950
  // 开启第一视角
785
951
  startFirstPer() {
@@ -935,9 +1101,9 @@ var roamConfig = {
935
1101
  },
936
1102
  // 返回主视角/恢复相机初始状态
937
1103
  home() {
938
- // if (roaming) {
939
- // this.disposeRoaming()
940
- // }
1104
+ if (roaming) {
1105
+ this.endRoam()
1106
+ }
941
1107
  cameraControls.reset(true);
942
1108
  cameraControls.update(0);
943
1109
  // this.timeRender()
@@ -1103,7 +1269,7 @@ var roamConfig = {
1103
1269
  animate() {
1104
1270
  const delta = fpsClock.getDelta();
1105
1271
  timeStamp += delta;
1106
- requestAnimationFrame(this.animate);
1272
+ animateId = requestAnimationFrame(this.animate);
1107
1273
  cameraControls.enabled && cameraControls.update(timeStamp);
1108
1274
  this.cameraTrack();
1109
1275
  this.firstPerspective();
@@ -36,7 +36,7 @@
36
36
  </template>
37
37
  <script>
38
38
  export default {
39
- name: 'PerControl',
39
+ name: 'FLPerControl',
40
40
  data() {
41
41
  return {};
42
42
  },
package/src/main.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import FlModel from '../packages/components/com-graphics/index.vue';
2
2
  import Fl2dcanvas from '../packages/components/com-flcanvas/index.vue';
3
+ import FLPerControl from '../packages/components/com-graphics/per-control.vue';
3
4
  import * as THREE from 'three';
4
5
  const components = [
5
6
  FlModel,
6
- Fl2dcanvas
7
+ Fl2dcanvas,
8
+ FLPerControl
7
9
  ];
8
10
 
9
11
  const install = (Vue) => {
@@ -21,5 +23,6 @@ if (typeof window !== 'undefined' && window.Vue) {
21
23
  export default {
22
24
  install,
23
25
  FlModel,
24
- Fl2dcanvas
26
+ Fl2dcanvas,
27
+ FLPerControl
25
28
  };
Binary file
@@ -31,72 +31,66 @@ function handleInstancedMeshModel(instances, drawObjs, type, scene, customColor,
31
31
  for (let i = 0; i < instances.length; i++) {
32
32
  formatInstancedMap(instances[i], drawObjs);
33
33
  }
34
- console.log('drawObjMapInstance', drawObjMapInstance)
35
34
  // 第二阶段:遍历所有实例进行处理
36
35
  for (let i = 0; i < instances.length; i++) {
37
36
  let targetGroup, instancedMeshIndex, drawObjectName;
38
- // for (let drawObjectId in drawObjMapInstance) {
39
- // const drawObj = drawObjMapInstance[drawObjectId];
40
- // drawObj.MapInstance.forEach((instance, index) => {
41
- // if (instance.instanceId == instances[i].instanceId) {
42
- // instancedMeshIndex = index;
43
- // drawObjectName = drawObjectId;
44
- // }
45
- // });
46
- // }
47
-
48
37
  const drawObjInstance = drawObjMapInstance[instances[i].drawObject];
49
- drawObjInstance.MapInstance.forEach((instance, index) => {
50
- if (instance.instanceId == instances[i].instanceId) {
51
- instancedMeshIndex = index;
52
- drawObjectName = instances[i].drawObject;
53
- }
54
- });
55
- if (drawObjectName) {
56
- targetGroup = scene.getObjectByName(drawObjectName);
57
- }
58
-
59
- if (!targetGroup) {
60
- const drawObj = drawObjMapInstance[instances[i].drawObject];
61
- const group = new THREE.Group();
62
- group.name = instances[i].drawObject;
63
- group.userData.isInstancedMeshGroup = true;
64
-
65
- const instanceCount = drawObj.MapInstance.length;
66
- drawObj.MapMesh?.forEach(mesh => {
67
- const model = drawModel(mesh, group.name, instanceCount, customColor);
68
- if (!model) {
69
- return;
70
- }
71
- let meshName = ''
72
- for (const key in meshNameConfig) {
73
- model.userData[key] = meshNameConfig[key]
74
- meshName += ':' + meshNameConfig[key]
38
+ if (drawObjInstance.MapMesh.length > 0) {
39
+ drawObjInstance.MapInstance.forEach((instance, index) => {
40
+ if (instance.instanceId == instances[i].instanceId) {
41
+ instancedMeshIndex = index;
42
+ drawObjectName = instances[i].drawObject;
75
43
  }
76
- drawObj.MapInstance.forEach((instance, index) => {
77
- if (instance.instanceId == instances[i].instanceId) {
78
- model.userData.instanceIndex = index;
79
- model.name = meshName !== '' ? (instances[i].instanceId + meshName) : instances[i].instanceId;
80
- const matrixVal = instance.matrix?.val;
81
- if (matrixVal) {
82
- const m4 = new THREE.Matrix4();
83
- // m4.setPosition(new THREE.Vector3(9999999, 9999999, 9999999)); // TODO 临时隐藏方案
84
- m4.elements = instance.matrix.val;
85
- model.setMatrixAt(index, m4);
86
- }
87
- // 需要先设置全部实例颜色,否则后续设置颜色无效
88
- const { color } = mesh.prop;
89
- const meshColor = customColor
90
- ? new THREE.Color(customColor)
91
- : new THREE.Color(`rgb(${color[0]}, ${color[1]}, ${color[2]})`);
92
- model.setColorAt(index, meshColor);
44
+ });
45
+ if (drawObjectName) {
46
+ targetGroup = scene.getObjectByName(drawObjectName);
47
+ }
48
+ if (!targetGroup) {
49
+ const drawObj = drawObjMapInstance[instances[i].drawObject];
50
+ const group = new THREE.Group();
51
+ group.name = instances[i].drawObject;
52
+ group.userData.isInstancedMeshGroup = true;
53
+
54
+ const instanceCount = drawObj.MapInstance.length;
55
+ drawObj.MapMesh?.forEach(mesh => {
56
+ const model = drawModel(mesh, group.name, instanceCount, customColor);
57
+ if (!model) {
58
+ return;
59
+ }
60
+ let meshName = ''
61
+ for (const key in meshNameConfig) {
62
+ model.userData[key] = meshNameConfig[key]
63
+ meshName += ':' + meshNameConfig[key]
93
64
  }
65
+ drawObj.MapInstance.forEach((item, index) => {
66
+ if (item.instanceId == instances[i].instanceId) {
67
+ model.userData.instanceIndex = index;
68
+ model.userData.instanceId = instances[i].instanceId
69
+ model.name = meshName !== '' ? (instances[i].instanceId + meshName) : instances[i].instanceId;
70
+ const matrixVal = item.matrix?.val;
71
+ if (matrixVal) {
72
+ const m4 = new THREE.Matrix4();
73
+ // m4.setPosition(new THREE.Vector3(9999999, 9999999, 9999999)); // TODO 临时隐藏方案
74
+ m4.elements = item.matrix.val;
75
+ model.setMatrixAt(index, m4);
76
+ const copyMatrix = new THREE.Matrix4().copy(m4);
77
+ model.userData.copyMatrix = copyMatrix;
78
+ }
79
+ // 需要先设置全部实例颜色,否则后续设置颜色无效
80
+ const { color } = mesh.prop;
81
+ const meshColor = customColor
82
+ ? new THREE.Color(customColor)
83
+ : new THREE.Color(`rgb(${color[0]}, ${color[1]}, ${color[2]})`);
84
+ model.setColorAt(index, meshColor);
85
+ }
86
+ });
87
+ // model.instanceColor.needsUpdate = true;
88
+ group.add(model);
94
89
  });
95
- // model.instanceColor.needsUpdate = true;
96
- group.add(model);
97
- });
98
- modelGroup.add(group);
90
+ modelGroup.add(group);
91
+ }
99
92
  }
93
+
100
94
  }
101
95
  console.log('modelGroup', modelGroup)
102
96
  return modelGroup;
@@ -401,7 +395,6 @@ function drawText(geom, instanceName, instanceCount) {
401
395
  mesh.translateY(-(fontsize / 2.5));
402
396
 
403
397
  mesh.userData.instanceName = instanceName;
404
-
405
398
  return mesh;
406
399
  }
407
400