添加网络分布

This commit is contained in:
hzz 2023-05-17 15:15:00 +08:00
parent 43650230bf
commit 57f8575716

View File

@ -380,6 +380,8 @@ const init = () => {
createSwitch({x:-208.35,y:0 ,z:107.47})
//
createSwitch({x:-40.22,y:0 ,z:19.90})
//
createSwitch({x:-81.96,y:0 ,z:-283.33})
//
createSwitch({x:-232.96,y:0 ,z:-64.48})
//
@ -388,6 +390,31 @@ const init = () => {
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})
/*交换机结束********************************* */
/*创建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: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})
/*创建红线******************/
@ -523,8 +550,8 @@ const init = () => {
const intersects = raycaster.intersectObjects(scene.children);
if (intersects.length > 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+6).toFixed(2) + ",y:0 ,z:" + (selected.point.z-33).toFixed(2)+ "}");
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-0.83).toFixed(2) + ",y:2 ,z:" + (selected.point.z+3.52).toFixed(2)+ "}");
let workerShop = intersects[0]?.object?.name
if (workerShopRoute.hasOwnProperty(workerShop) && !edit) {
//router.push({ path: workerShopRoute[workerShop] })
@ -654,14 +681,37 @@ function createLine(color: number, pointsList: any) {
}
//wifi
function createWifi(position: positionType) {
const loader = new GLTFLoader();
loader.load('/models/glb/tothefuture_wifi.glb', function (gltf) {
const mesh = gltf.scene.children[0];
console.log(mesh);
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) {
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 = 0.2;
const s = scale;
mesh.scale.set(s, s, 0.5);
mesh.position.set(position.x, position.y, position.z);
// mesh.rotation.z = THREE.MathUtils.degToRad(180)