Merge remote-tracking branch 'remotes/origin/dismap'

This commit is contained in:
hzz 2023-05-24 10:05:00 +08:00
commit 6722c22c72
10 changed files with 556 additions and 15 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4025145 */ font-family: "iconfont"; /* Project id 4025145 */
src: url('iconfont.woff2?t=1681876255746') format('woff2'), src: url('//at.alicdn.com/t/c/font_4025145_25o1en7emhw.woff2?t=1684836220462') format('woff2'),
url('iconfont.woff?t=1681876255746') format('woff'), url('//at.alicdn.com/t/c/font_4025145_25o1en7emhw.woff?t=1684836220462') format('woff'),
url('iconfont.ttf?t=1681876255746') format('truetype'); url('//at.alicdn.com/t/c/font_4025145_25o1en7emhw.ttf?t=1684836220462') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-zhongduananquanjierukongzhiqi:before {
content: "\e649";
}
.icon-guangmao:before {
content: "\e612";
}
.icon-WIFI:before {
content: "\e63f";
}
.icon-tuoputu_jiaohuanjizu:before {
content: "\e639";
}
.icon-angle-right:before { .icon-angle-right:before {
content: "\e84e"; content: "\e84e";
} }
@ -20,4 +36,3 @@
.icon-angle-left:before { .icon-angle-left:before {
content: "\e84f"; content: "\e84f";
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -14,7 +14,7 @@ import { getSensorInfodata , deviceDistributeInMachineryFactorydata} from "@/htt
import { connectWebsocket, closeWebsocket } from "@/utils/websocket"; import { connectWebsocket, closeWebsocket } from "@/utils/websocket";
import { useFactoryStore } from '@/store/module/Factory'; import { useFactoryStore } from '@/store/module/Factory';
import statusBar from '@/components/mapStatus/statusBar.vue'; import statusBar from './statusBar.vue';
const store = useFactoryStore(); const store = useFactoryStore();
let Acontent = ref(); let Acontent = ref();

View File

@ -0,0 +1,188 @@
<!--
* @FilePath: \screenFront\src\views\FactoryView\statusBar.vue
* @Author: 王路平
* @文件版本: V1.0.0
* @Date: 2023-04-04 08:11:07
* @Description:
*
* 版权信息 : 2023 by ${再登软件}, All Rights Reserved.
-->
<template>
<div ref="statusbarref" :key="numkey">
<div class="tip-box-border" :class="{show}" @click="rtract" :style="{width: mapSize.width+'px',height:mapSize.height+'px'}" >
<!-- <div class="DirectionalSign">
</div> -->
<div class="iconTip">
<ul>
<li v-for="item in prop.iconList" :key="item.id" >
<i :class="'iconfont ' + item.name + ' icon-logo'"></i
>{{ "&nbsp&nbsp&nbsp" + item.value }}
<div>{{ `&nbsp${item.counts}/${item.allnum}` }}</div>
</li>
<li v-for="item in prop.devList" :key="item.id" >
<i :class="'iconfont ' + item.name + ' icon-logo SSCBar'"></i
>{{ "&nbsp&nbsp&nbsp" + item.value }}
<div>{{ `&nbsp${item.counts}/${item.allnum}` }}</div>
</li>
<li>
<i class="iconfont icon-WIFI icon-logo"></i> &nbsp;&nbsp;&nbsp;
WIFI
<div> &nbsp; 16/16</div>
</li>
<li>
<i class="iconfont icon-guangmao icon-logo"></i> &nbsp;&nbsp;&nbsp;
光猫
<div> &nbsp; 9/9</div>
</li>
<li>
<i class="iconfont icon-zhongduananquanjierukongzhiqi icon-logo"></i> &nbsp;&nbsp;&nbsp;
AC
<div> &nbsp; 3/3</div>
</li>
</ul>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { number } from "echarts/core";
import {reactive, ref, watch,defineProps} from "vue"
const prop = defineProps({
iconList: {
type: Object,
default: {},
},
devList: {
type: Object,
default: {},
},
width: {
type: Number,
default: 0,
},
height: {
type: Number,
default: 0,
},
});
const afterDisplay = ref("none")
const beforeDisplay = ref("block")
const show = ref(true)
let numkey=ref(0)
let statusbarref=ref()
let mapSize = reactive({
width: 0,
height: 0,
});
function rtract() {
show.value = !show.value;
if (show.value) {
afterDisplay.value = "none";
beforeDisplay.value = "block";
} else {
afterDisplay.value = "block";
beforeDisplay.value = "none";
}
}
watch(
() => prop,
(newVal, oldVal) => {
//
reset(newVal);
},
{ immediate: true, deep: true, flush: "post" }
);
function reset(val: any) {
//0
if (!val.width && !val.height) return;
mapSize.width=val.width
mapSize.height=val.height
numkey.value++
// statusbarref.value.style.width=val.width
// statusbarref.value.style.height=val.height
//
}
</script>
<style scoped>
@import url("@/assets/css/iconfont.css");
@import url("@/assets/css/newicon/iconfont.css");
.tip-box-border{
position: fixed;
top: 0;
bottom: 0;
left: 0;
height: 97%;
width: 99%;
padding-top: 100px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
z-index: 999;
background-color:rgba(0,0,0,0.5);
transition: transform 0.5s;
}
.show {
transform: translateX(-90%);
}
.tip-box-border::after{
content: "\e84f";
position: absolute;
top: 50%;
right: 0;
font-size: 24px;
font-family: 'iconfont' !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
display: v-bind(afterDisplay);
color: #fff;
box-sizing: border-box;
}
.tip-box-border::before{
content: '\e84e';
/* content: "\e84e"; */
position: absolute;
top: 50%;
right: 0;
font-size: 24px;
font-family: 'iconfont' !important;
font-style: normal;
display: v-bind(beforeDisplay);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #fff;
box-sizing: border-box;
}
.DirectionalSign{
width: 60%;
height: 20%;
background-image: url(@/assets/img/AerialView/direction.png);
background-size: 100% 100%;
}
.iconTip{
width: 100%;
height: 80%;
}
.iconTip>ul>li{
padding-left: 10%;
margin-top: 10px;
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 1.5rem;
color: #fff;
}
.iconTip>ul>li>i{
font-size: 1.5rem;
}
</style>

View File

@ -9,8 +9,11 @@ import * as TWEEN from '@tweenjs/tween.js';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
import * as SceneUtils from 'three/examples/jsm/utils/SceneUtils.js'; import * as SceneUtils from 'three/examples/jsm/utils/SceneUtils.js';
import { CSS2DRenderer, CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js'; import { CSS2DRenderer, CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
import { CSS3DRenderer, CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
import { DragControls } from "@/utils/DragControls"; import { DragControls } from "@/utils/DragControls";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
import { Line2 } from 'three/examples/jsm/lines/Line2'
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry'
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial'
import { useFactoryStore } from "@/store/module/Factory" import { useFactoryStore } from "@/store/module/Factory"
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { updateCoordinateByPoint } from "@/http/AerialView/index" import { updateCoordinateByPoint } from "@/http/AerialView/index"
@ -57,13 +60,15 @@ const requires = {
'燃气': require('@/assets/img/Factory/ranqi.jpg'), '燃气': require('@/assets/img/Factory/ranqi.jpg'),
'设备': require('@/assets/img/Factory/shebei.jpg'), '设备': require('@/assets/img/Factory/shebei.jpg'),
'ny': require("@/assets/img/Factory/ny.jpg"), 'ny': require("@/assets/img/Factory/ny.jpg"),
'wood': require("@/assets/img/Factory/wood.jpg"), 'wood': require("@/assets/img/Factory/wood4.jpg"),
// 'wall1': require("@/assets/img/Factory/floor1.jpeg"), // 'wall1': require("@/assets/img/Factory/floor1.jpeg"),
'wall1': require("@/assets/img/Factory/wall1.jpg"), 'wall1': require("@/assets/img/Factory/wall1.jpg"),
'tile': require("@/assets/img/Factory/tile.jpg"), 'tile': require("@/assets/img/Factory/tile.jpg"),
'door': require("@/assets/img/Factory/door.jpg"), 'door': require("@/assets/img/Factory/door.jpg"),
'sky': require("@/assets/img/Factory/sky.jpg"), 'sky': require("@/assets/img/Factory/sky.jpg"),
'titleFloor': require("@/assets/img/Factory/screen_title.png"), 'titleFloor': require("@/assets/img/Factory/screen_title.png"),
'guangmao': require("@/assets/img/Factory/guangmao.jpg"),
'ac': require("@/assets/img/Factory/ac.jpg"),
} }
const workerShopRoute = { const workerShopRoute = {
@ -265,6 +270,12 @@ const init = () => {
// //
const mesh_hr = createFloor(t('messages.machineDesign'), 45, 120, { x: -431, y: 0, z: 102 }) const mesh_hr = createFloor(t('messages.machineDesign'), 45, 120, { x: -431, y: 0, z: 102 })
createLableObj(mesh_hr, t('messages.machineDesign'), { x: 0, y: 60, z: 0 }) createLableObj(mesh_hr, t('messages.machineDesign'), { x: 0, y: 60, z: 0 })
const mesh_serve = createFloor('', 45, 48, { x: -364.5, y: 0, z: 58 })
createLableObj(mesh_serve, t('messages.服务器机房'), { x: 0, y: 60, z: 0 })
// //
const mesh_dkcj = createFloor(t('messages.ControllerRoom'), 76.5, 237, { x: -266, y: 0, z: -138.5 }) const mesh_dkcj = createFloor(t('messages.ControllerRoom'), 76.5, 237, { x: -266, y: 0, z: -138.5 })
createLableObj(mesh_dkcj, t('messages.ControllerRoom'), { x: 0, y: 60, z: 0 }) createLableObj(mesh_dkcj, t('messages.ControllerRoom'), { x: 0, y: 60, z: 0 })
@ -328,10 +339,10 @@ const init = () => {
// createUseWall('', { baseWidth: 82, baseHeght: 30, baseLength: 1 }, { x: 228, y: 0, z: 183.5 }) // createUseWall('', { baseWidth: 82, baseHeght: 30, baseLength: 1 }, { x: 228, y: 0, z: 183.5 })
createUseWall('料场后面的墙', { baseWidth: 82, baseHeght: 30, baseLength: 1 }, { x: 228, y: 0, z: 308 }) createUseWall('料场后面的墙', { baseWidth: 82, baseHeght: 30, baseLength: 1 }, { x: 228, y: 0, z: 308 })
const mesh_lc = createFloor('料场', 84, 131, { x: 188, y: 0, z: 110 }) const mesh_lc = createFloor('料场', 84, 131, { x: 188, y: 0, z: 110 })
createLableObj(mesh_lc, '料场', { x: 0, y: 60, z: 0 }) createLableObj(mesh_lc, t('messages.料场'), { x: 0, y: 60, z: 0 })
const mesh_wfzcq = createFloor('料场', 84, 132, { x: 188, y: 0, z: 242 }) const mesh_wfzcq = createFloor('料场', 84, 132, { x: 188, y: 0, z: 242 })
createLableObj(mesh_wfzcq, '危废暂存间', { x: 0, y: 60, z: 0 }) createLableObj(mesh_wfzcq, t('messages.危废暂存间'), { x: 0, y: 60, z: 0 })
@ -369,8 +380,182 @@ const init = () => {
createTitleFloor('', 464, 45, { x: 0, y: 0, z: 15 }) createTitleFloor('', 464, 45, { x: 0, y: 0, z: 15 })
//
createGlb()
/*放置光猫************/
//
createSwitch({ x: -287.44, y: 0, z: 19.24 })
//
createSwitch({ x: -158.01, y: 0, z: 107.47 })
createSwitch({ x: -208.35, y: 0, z: 107.47 })
//
createSwitch({ x: -40.22, y: 0, z: 19.90 })
//
createSwitch({ x: -232.96, y: 0, z: -64.48 })
//
createSwitch({ x: 29.01, y: 0, z: -60.75 })
//
createSwitch({ x: 5.29, y: 0, z: 19.00 })
//
createSwitch({ x: 88.55, y: 0, z: -214.89 })
//
createSwitch({ x: 306.5, y: 0, z: 5.43 })
/*光猫结束********************************* */
/**创建ac */
createAc({x:52.56,y:0,z:52.24})
//
createAc({x:-88.39,y:0,z:-249.36})
createAc({x:82.99,y:0,z:-170.17})
/**创建AC结束 */
/*创建wifi */
//
createWifi({ x: -46.96, y: 2, z: 156.57 })
//
createWifi({ x: 52.60, y: 2, z: 96.44 })
createWifi({ x: 52.60, y: 2, z: 157.07 })
//
createWifi({ x: 133.14, y: 2, z: 107.43 })
createWifi({ x: 133.14, y: 2, z: 156.25 })
//
createWifi({ x: 305.73, y: 2, z: 110.45 })
createWifi({ x: 305.73, y: 2, z: 238.67 })
//
createWifi({ x: -89.13, y: 4, z: -245.33 })
createWifi({ x: -132.07, y: 2, z: -245.33 })
createWifi({ x: -222.31, y: 2, z: -245.33 })
createWifi({ x: -119.3, y: 2, z: -114.15 })
createWifi({ x: -176.45, y: 2, z: -114.40 })
//
createWifi({ x: 140.83, y: 2, z: -197.34 })
createWifi({ x: 259.37, y: 2, z: -197.34 })
createWifi({ x: 140.83, y: 2, z: -111.84 })
createWifi({ x: 259.50, y: 2, z: -111.81 })
/*创建第一条线******************/
let garyLine = 0x595959;
let whiteColor = 0xffffff;
createLine(whiteColor, [{ x: -346.00, y: 23.6, z: 59.40 }, { x: -160.50, y: 2, z: 142.08 }], 2)
//
createLine(whiteColor, [
{ x: -345.65, y: 2, z: 36.40 },
{ x: 22.67, y: 2, z: 36.40 },
{ x: 22.67, y: 2, z: -25.70 },
], 2)
createLine(garyLine, [
{ x: 22.67, y: 2, z: -25.70 },
{ x: -47.67, y: 2, z: -25.70 },
{ x: -47.67, y: 2, z: -248.85 },
{ x: -221.76, y: 2, z: -248.85 }
])
createLine(garyLine, [{x:-88.73,y:2,z:-249.01},{x:-88.73,y:2,z:-117.33} , { x: -174.65, y: 2, z: -117.33 }])
//
createLine(whiteColor, [{ x: -293.44, y: 2, z: 52.52 }, { x: -293.44, y: 2, z: 36.40 }, { x: -235.84, y: 2, z: -30.87 }], 2)
//
createLine(whiteColor, [
{ x: -114.64, y: 2, z: 36.40 },
{ x: -114.64, y: 2, z: 52.42 },
{ x: -46.13, y: 2, z: 52.90 },
], 2)
createLine(garyLine, [
{ x: -46.13, y: 2, z: 52.90 },
{ x: -46.13, y: 2, z: 153.05 }
])
//
createLine(garyLine, [
{ x: 27.47, y: 2, z: -26.11 },
{ x: 27.47, y: 2, z: -248.85 },
{ x: 69.26, y: 2, z: -248.85 },
{ x: 69.26, y: 2, z: -180.29 },
{ x: 85.51, y: 2, z: -180.29 },
{ x: 141.66, y: 2, z: -200.86 },
{ x: 260.42, y: 2, z: -200.86 },
{ x: 260.42, y: 2, z: -115.33 },
{ x: 141.66, y: 2, z: -115.33 },
{ x: 141.66, y: 2, z: -200.86 },
])
//线
//线
createLine(whiteColor, [
{ x: -341.87, y: 2, z: 30.98 },
{ x: 111.97, y: 2, z: 30.98 },
{ x: 111.97, y: 2, z: 175.55 },
{ x: 294.54, y: 2, z: 175.55 },
{ x: 294.54, y: 2, z: 40.43 },
{ x: 306.56, y: 2, z: 40.43 }
], 2)
createLine(garyLine, [
{ x: 306.56, y: 2, z: 40.43 },
{ x: 306.56, y: 2, z: 235.28 }
])
//
createLine(whiteColor, [
{ x: -164.26, y: 2, z: 30.98 },
{ x: -164.26, y: 2, z: 140.05 }
],2)
createLine(garyLine, [
{ x: -164.26, y: 2, z: 140.05 },
{ x: -214.35, y: 2, z: 140.05 }
])
// ---
createLine(garyLine, [
{ x: 26.61, y: 2, z: -27.08 },
{ x: 26.61, y: 2, z: 39.27 },
{ x: -0.90, y: 2, z: 39.27 },
{x:-0.90,y:2,z:52.24},
{ x: 133.97, y: 2, z: 53.16 },
{ x: 133.97, y: 2, z: 154.31 }
])
//
createLine(garyLine, [
{ x: 53.43, y: 2, z: 53.16 },
{ x: 53.43, y: 2, z: 154.31 }
])
/**
*
{ x: 26.61, y: 2, z: -27.08 },
{ x: 26.61, y: 2, z: 39.27 },
{ x: -0.90, y: 2, z: 39.27 },
{ x: 53.43, y: 2, z: 154.31 }
*/
//
createLine(whiteColor, [
{ x: -292.24, y: 2, z: 30.98 },
{ x: -242.61, y: 2, z: -30.90 }
], 2)
//
createLine(whiteColor, [
{ x: 18.30, y: 2, z: 30.98 },
{ x: 18.30, y: 2, z: -28.94 }
], 2)
//
createLine(garyLine, [
{ x: 18.30, y: 2, z: -28.94 },
{ x: 25.64, y: 2, z: -28.94 },
{ x: 25.64, y: 2, z: -251.40 },
{ x: 71.44, y: 2, z: -251.40 },
{ x: 71.44, y: 2, z: -183.05 },
{ x: 83.96, y: 2, z: -183.05 }
])
createLine(whiteColor, [
{ x: 18.30, y: 2, z: 30.98 },
{ x: 18.30, y: 2, z: -28.94 }
],2)
setTipDom() setTipDom()
sethoveMesh() sethoveMesh()
@ -406,8 +591,8 @@ const init = () => {
//widthheightcanvas //widthheightcanvas
const x = (px / iw) * 2 - 1; const x = (px / iw) * 2 - 1;
const y = -(py / ih) * 2 + 1; const y = -(py / ih) * 2 + 1;
console.log("鼠标点击位置", "x:" + x, "y:" + y); // console.log("", "x:" + x, "y:" + y);
console.log("鼠标点击位置", "px:" + px, "py:" + py); // console.log("", "px:" + px, "py:" + py);
//线`Raycaster` //线`Raycaster`
@ -420,9 +605,10 @@ const init = () => {
const intersects = raycaster.intersectObjects(scene.children); const intersects = raycaster.intersectObjects(scene.children);
if (intersects.length > 0) { if (intersects.length > 0) {
var selected = intersects[0]; // var selected = intersects[0]; //
console.log("坐标", "{x:" + selected.point.x.toFixed(2) + ",y:" + (selected.point.y.toFixed(2) - 1) + ",z:" + selected.point.z.toFixed(2) + "}"); console.log("坐标", "{x:" + selected.point.x.toFixed(2) + ",y:" + (selected.point.y.toFixed(2) - 1) + ",z:" + selected.point.z.toFixed(2) + "}", selected.object.name);
// console.log("", "{x:" + (+selected.point.x - 0.83).toFixed(2) + ",y:2 ,z:" + (selected.point.z + 3.52).toFixed(2) + "}");
let workerShop = intersects[0]?.object?.name let workerShop = intersects[0]?.object?.name
if (workerShopRoute.hasOwnProperty(workerShop)&&!edit) { if (workerShopRoute.hasOwnProperty(workerShop) && !edit) {
router.push({ path: workerShopRoute[workerShop] }) router.push({ path: workerShopRoute[workerShop] })
} }
@ -535,6 +721,156 @@ const init = () => {
//线
function createLine(color: number, pointsList: any, width: number = 4) {
// const material = new THREE.LineBasicMaterial({ color: color });
// const points = [];
// pointsList.forEach(element => {
// points.push(new THREE.Vector3(element.x, element.y, element.z));
// });
// const geometry = new THREE.BufferGeometry().setFromPoints(points);
// const line = new THREE.Line(geometry, material);
// scene.add(line);
// renderer.render(scene, camera);
const geometry = new LineGeometry()
let pointList = []
pointsList.forEach(element => {
let { x, y, z } = element
let arr = [x, y, z]
pointList.push(...arr)
});
geometry.setPositions(pointList)
const material = new LineMaterial({
color: color,
transparent: true,
// opacity: 0.5,
dashed: width !== 2?true:false,
dashScale: 1,
dashSize: 3,
gapSize: 1,
linewidth: width
})
//console.log(material,'material');
material.resolution.set(iw, ih)
// 5. Line2
var line = new Line2(geometry, material);
// 6. 线
line.computeLineDistances();
// 7.
scene.add(line)
}
//wifi
function createWifi(position: positionType) {
const loader = new GLTFLoader();
loader.load('/models/glb/tothefuture_wifi.glb', function (gltf) {
const mesh = gltf.scene.children[0];
const s = 0.3;
mesh.scale.set(s, s, s);
mesh.position.set(position.x, position.y, position.z);
// mesh.rotation.x = THREE.MathUtils.degToRad(270)
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
}, undefined, function (error) {
console.error(error);
});
}
//
// function createSwitch(position: positionType, scale: number = 0.2) {
// const loader = new GLTFLoader();
// loader.load('/models/gltf/scene.gltf', function (gltf) {
// const mesh = gltf.scene.children[0];
// const s = scale;
// mesh.scale.set(s, s, 0.5);
// mesh.position.set(position.x-12.75, position.y, position.z+66.22);
// mesh.rotation.z = THREE.MathUtils.degToRad(180)
// // mesh.rotation.y = THREE.MathUtils.degToRad(90)
// // mesh.rotation.x = THREE.MathUtils.degToRad(45)
// mesh.castShadow = true;
// mesh.receiveShadow = true;
// scene.add(mesh);
// }, undefined, function (error) {
// console.error(error);
// });
// }
const createSwitch = (boxposition: positionType, shadow: boolean = true): object => {
const wallTexture = new THREE.TextureLoader().load(requires.guangmao);
const wall = new THREE.BoxGeometry(15, 5, 10);
const wallMaterial = new THREE.MeshPhongMaterial({
map: wallTexture,
color: 0xe7e7e7,
transparent: true,
});
//
const wallMesh = new THREE.Mesh(wall, wallMaterial);
//
// wallMesh.position.set((-size.baseWidth / 2 + boxposition.x + 1), size.baseHeght / 2 + boxposition.y, -size.baseLength / 2 + boxposition.z);
wallMesh.position.set(boxposition.x - 6, 5 + boxposition.y, boxposition.z + 33.73);
//
group.add(wallMesh)
return wallMesh
}
const createAc = (boxposition: positionType, shadow: boolean = true): object => {
const wallTexture = new THREE.TextureLoader().load(requires.ac);
const wall = new THREE.BoxGeometry(15, 5, 10);
const wallMaterial = new THREE.MeshPhongMaterial({
map: wallTexture,
color: 0xe7e7e7,
transparent: true,
});
//
const wallMesh = new THREE.Mesh(wall, wallMaterial);
//
// wallMesh.position.set((-size.baseWidth / 2 + boxposition.x + 1), size.baseHeght / 2 + boxposition.y, -size.baseLength / 2 + boxposition.z);
wallMesh.position.set(boxposition.x, 5 + boxposition.y, boxposition.z);
//
group.add(wallMesh)
return wallMesh
}
//
function createGlb() {
const loader = new GLTFLoader();
loader.load('/models/glb/server.glb', function (gltf) {
const mesh = gltf.scene.children[0];
const s = 0.12;
mesh.scale.set(s, s, s);
mesh.position.set(-346, 0, 51);
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
}, undefined, function (error) {
console.error(error);
});
}
type positionType = { type positionType = {
@ -557,7 +893,7 @@ function createHouse(houseName: string, size = { baseWidth: 40, baseHeght: 4, ba
const mesh = createFloor('焊接车间', baseWidth, baseLength, position) const mesh = createFloor('焊接车间', baseWidth, baseLength, position)
createLableObj(mesh, t('messages.HanJieRoom'), { x: 0, y: 60, z: 0 }) createLableObj(mesh, t('messages.HanJieRoom'), { x: 0, y: 60, z: 0 })
} else { } else {
const mesh = createFloor('houseName', baseWidth, baseLength, position) const mesh = createFloor(houseName, baseWidth, baseLength, position)
createLableObj(mesh, houseName, { x: 0, y: 60, z: 0 }) createLableObj(mesh, houseName, { x: 0, y: 60, z: 0 })
} }
} }
@ -724,6 +1060,8 @@ function createWall(baseWidth: number = 10, baseHeght: number, baseLength: numbe
const wall = new THREE.BoxGeometry(baseLength, baseHeght, baseWidth); const wall = new THREE.BoxGeometry(baseLength, baseHeght, baseWidth);
const wallMaterial = new THREE.MeshPhongMaterial({ const wallMaterial = new THREE.MeshPhongMaterial({
map: wallTexture, map: wallTexture,
color: 0xffffff,
transparent: true,
}); });
// //
const wallMesh = new THREE.Mesh(wall, wallMaterial); const wallMesh = new THREE.Mesh(wall, wallMaterial);
@ -894,7 +1232,7 @@ function sethoveMesh() {
); );
if (!edit) { if (!edit) {
dragControls.deactivate(); dragControls.deactivate();
} }
dragControls.addEventListener("hoveron", function (event: any) { dragControls.addEventListener("hoveron", function (event: any) {
saveTipDom.element.innerHTML = `${event.object.name}:${event.object.devStatus ? t('messages.onLine') : t('messages.offline') saveTipDom.element.innerHTML = `${event.object.name}:${event.object.devStatus ? t('messages.onLine') : t('messages.offline')