|
@@ -6,9 +6,8 @@ import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js';
|
|
|
import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader.js';
|
|
|
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';
|
|
|
import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass.js';
|
|
|
-import { setModalCenter, setTag3D } from '/@/utils/threejs/util';
|
|
|
+import { setModalCenter, setTag3D, gradientColors } from '/@/utils/threejs/util';
|
|
|
import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
|
|
|
-import { gradientColors } from '/@/utils/threejs/util';
|
|
|
|
|
|
// import * as dat from 'dat.gui';
|
|
|
// const gui = new dat.GUI();
|
|
@@ -117,7 +116,7 @@ class WorkFace {
|
|
|
gasUnitCSS3D.scale.set(0.0009, 0.0009, 0.0009);
|
|
|
gasUnitCSS3D.position.set(-0.1, 0.11, 0.05);
|
|
|
gasUnitCSS3D.lookAt(-0.1, 0.5, 1);
|
|
|
- this.group.add(gasUnitCSS3D);
|
|
|
+ this.planeGroup.add(gasUnitCSS3D);
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i < this.planeNum; i++) {
|
|
@@ -350,26 +349,34 @@ class WorkFace {
|
|
|
}
|
|
|
|
|
|
setModalType(modalType) {
|
|
|
- const intakeWind = this.group.getObjectByName('workFace-jin');
|
|
|
- const returnWind = this.group.getObjectByName('workFace-hui');
|
|
|
- if (intakeWind && returnWind) {
|
|
|
+ debugger;
|
|
|
+ const workFace2 = this.group.getObjectByName('workFace2-1');
|
|
|
+ const workFace1 = this.group.getObjectByName('workFace1-1');
|
|
|
+ // const workFace3 = this.group.getObjectByName('workFace2-2');
|
|
|
+ if (workFace2 && workFace1) {
|
|
|
if (modalType === 'workFace1') {
|
|
|
// 单进单回
|
|
|
- intakeWind.visible = false;
|
|
|
- returnWind.visible = false;
|
|
|
- } else if (modalType === 'workFace2') {
|
|
|
- // 单进双回
|
|
|
- intakeWind.visible = false;
|
|
|
- returnWind.visible = true;
|
|
|
+ workFace2.visible = false;
|
|
|
+ // workFace3.visible = false;
|
|
|
+ workFace1.visible = true;
|
|
|
+ workFace1.add(this.planeGroup);
|
|
|
+ this.planeGroup.visible = false;
|
|
|
+ this.planeGroup.position.set(-0.35, 0.14, -0.21);
|
|
|
} else if (modalType === 'workFace3') {
|
|
|
// 双进单回
|
|
|
- intakeWind.visible = true;
|
|
|
- returnWind.visible = false;
|
|
|
- } else if (modalType === 'workFace4') {
|
|
|
- // 双进双回
|
|
|
- intakeWind.visible = true;
|
|
|
- returnWind.visible = true;
|
|
|
+ workFace1.visible = false;
|
|
|
+ // workFace3.visible = false;
|
|
|
+ workFace2.visible = true;
|
|
|
+ workFace2.add(this.planeGroup);
|
|
|
+ this.planeGroup.visible = false;
|
|
|
+ this.planeGroup.position.set(-0.35, 0.14, -0.21);
|
|
|
}
|
|
|
+ // else if (modalType === 'workFace4') {
|
|
|
+ // // 双进双回
|
|
|
+ // workFace2.visible = false;
|
|
|
+ // workFace3.visible = true;
|
|
|
+ // workFace1.visible = false;
|
|
|
+ // }
|
|
|
setModalCenter(this.group);
|
|
|
}
|
|
|
}
|
|
@@ -380,10 +387,14 @@ class WorkFace {
|
|
|
// this.model.camera.position.set(0, 3.1, 500);
|
|
|
// this.setRenderPass();
|
|
|
this.model.orbitControls.update();
|
|
|
- this.model.setGLTFModel(['workFace-base', 'workFace-jin', 'workFace-hui'], this.group).then(async () => {
|
|
|
+ this.model.setGLTFModel(['workFace2-1', 'workFace1-1'], this.group).then(async () => {
|
|
|
+ this.group.children.forEach((object: THREE.Object3D) => {
|
|
|
+ if (object.name.startsWith('workFace')) {
|
|
|
+ setModalCenter(object);
|
|
|
+ }
|
|
|
+ });
|
|
|
this.group.name = this.modelName;
|
|
|
- this.group.add(this.planeGroup);
|
|
|
- this.planeGroup.visible = false;
|
|
|
+
|
|
|
// this.group.position.set(-0.06, 0.28, 0.07);
|
|
|
this.group.scale.set(2.5, 2.5, 2.5);
|
|
|
// this.resetMesh();
|