fl-web-component 1.2.3 → 1.2.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "fl-web-component",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "scripts": {
5
5
  "tip1": "仅调试本组件不涉及业务组件,请执行dev",
6
6
  "dev": "vue-cli-service serve",
@@ -112,6 +112,10 @@ function parseData(input) {
112
112
  };
113
113
 
114
114
  geomList.push({
115
+ matrix: {
116
+ val: primitive.matrix,
117
+ },
118
+ prmid: primitive.prmid,
115
119
  geomId: primitiveData.id,
116
120
  type: primitiveData.geomType,
117
121
  text: primitiveData.geomText,
@@ -138,7 +142,7 @@ function parseData(input) {
138
142
  drawObjs: Array.from(drawObjMap.values()),
139
143
  instances: formatInstances,
140
144
  };
141
- // console.log('parseData', map);
145
+ console.log('parseData', map);
142
146
  return map;
143
147
  }
144
148
 
@@ -86,13 +86,18 @@ function handleInstancedMeshModel(
86
86
  if (item.instanceId == instances[i].instanceId) {
87
87
  model.userData.instanceIndex = index;
88
88
  model.userData.instanceId = instances[i].instanceId;
89
+ model.userData.primId = mesh.prmid;
89
90
  model.name =
90
91
  meshName !== '' ? instances[i].instanceId + meshName : instances[i].instanceId;
91
92
  const matrixVal = item.matrix?.val;
92
93
  if (matrixVal) {
93
94
  const m4 = new THREE.Matrix4();
95
+ const meshMatrix = new THREE.Matrix4();
96
+ const geomMatrix = new THREE.Matrix4();
94
97
  // m4.setPosition(new THREE.Vector3(9999999, 9999999, 9999999)); // TODO 临时隐藏方案
95
- m4.elements = item.matrix.val;
98
+ meshMatrix.elements = item.matrix.val;
99
+ geomMatrix.elements = mesh.matrix.val;
100
+ m4.multiplyMatrices(meshMatrix, geomMatrix);
96
101
  model.setMatrixAt(index, m4);
97
102
  const copyMatrix = new THREE.Matrix4().copy(m4);
98
103
  model.userData.copyMatrix = copyMatrix;
@@ -112,8 +117,8 @@ function handleInstancedMeshModel(
112
117
  }
113
118
  }
114
119
  }
115
- // console.log('modelGroup', modelGroup);
116
- // console.log('drawObjMapInstance', drawObjMapInstance);
120
+ console.log('modelGroup', modelGroup);
121
+ console.log('drawObjMapInstance', drawObjMapInstance);
117
122
  return modelGroup;
118
123
  // timeRender();
119
124
  // console.log('scene', scene)
@@ -318,8 +323,9 @@ function draw3Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
318
323
  material = customMaterial ||
319
324
  new THREE.MeshStandardMaterial({
320
325
  ...materialOptions,
321
- roughness: 0.8,
322
- envMapIntensity: 0.5, // 调低环境贴图的强度
326
+ roughness: 0.6,
327
+ metalness: 0.5,
328
+ envMapIntensity: 1, // 调低环境贴图的强度
323
329
  // wireframe: true
324
330
  });
325
331