代码提交

This commit is contained in:
lixiaobang 2023-02-06 08:36:33 +08:00
parent 80e7e9b2e5
commit c28d0d195f
9 changed files with 15617 additions and 17836 deletions

View File

@ -1,7 +1,7 @@
# 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware # 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware
# File Created: 14.01.2023 10:09:05 # File Created: 31.01.2023 09:36:42
newmtl Tex_equipment_DianXiang_a newmtl 10kV_hwg
Kd 0.5000 0.5000 0.5000 Kd 0.5000 0.5000 0.5000
Ks 1.0000 1.0000 1.0000 Ks 1.0000 1.0000 1.0000
Tr 0.0000 Tr 0.0000
@ -14,4 +14,4 @@ newmtl Tex_equipment_DianXiang_a
Ni 1.5200 Ni 1.5200
Ke 0.0000 0.0000 0.0000 Ke 0.0000 0.0000 0.0000
illum 2 illum 2
map_Kd ..\10kv_环网柜/Tex_equipment_DianXiang_a.jpg map_Kd Tex_equipment_DianXiang_a.jpg

View File

@ -1,7 +1,7 @@
# 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware # 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware
# File Created: 14.01.2023 10:09:05 # File Created: 31.01.2023 09:36:42
mtllib 10kV_ťˇÍřšń\10kV_hwg.mtl mtllib 10kV_hwg.mtl
# #
# object 10kV_CXX_1_hwg # object 10kV_CXX_1_hwg
@ -323,7 +323,7 @@ vt 0.4989 0.0003 0.0000
o 10kV_CXX_1_hwg o 10kV_CXX_1_hwg
g 10kV_CXX_1_hwg g 10kV_CXX_1_hwg
usemtl Tex_equipment_DianXiang_a usemtl 10kV_hwg
s 2 s 2
f 1/1/1 2/2/2 3/3/3 f 1/1/1 2/2/2 3/3/3
f 3/3/4 4/4/5 1/1/6 f 3/3/4 4/4/5 1/1/6
@ -413,10 +413,10 @@ f 36/68/202 30/44/203 34/49/204
v -252.4226 4.5644 -237.6758 v -252.4226 4.5644 -237.6758
v -216.8514 4.5644 -237.6758 v -216.8514 4.5644 -237.6758
v -216.8514 4.5644 -226.4946 v -216.8514 4.5644 -226.4947
v -252.4226 4.5644 -226.4946 v -252.4226 4.5644 -226.4947
v -216.8514 27.0448 -226.4946 v -216.8514 27.0448 -226.4947
v -252.4226 27.0448 -226.4946 v -252.4226 27.0448 -226.4947
v -216.8514 27.0448 -237.6758 v -216.8514 27.0448 -237.6758
v -216.8514 4.5644 -248.8569 v -216.8514 4.5644 -248.8569
v -252.4226 4.5644 -248.8569 v -252.4226 4.5644 -248.8569
@ -426,14 +426,14 @@ v -252.4226 27.0448 -237.6758
v -217.8634 27.0448 -227.4485 v -217.8634 27.0448 -227.4485
v -251.1589 27.0448 -227.4485 v -251.1589 27.0448 -227.4485
v -217.8634 27.0448 -237.7969 v -217.8634 27.0448 -237.7969
v -251.1589 27.0448 -248.1452 v -251.1589 27.0448 -248.1453
v -217.8634 27.0448 -248.1452 v -217.8634 27.0448 -248.1453
v -251.1589 27.0448 -237.7969 v -251.1589 27.0448 -237.7969
v -217.8634 27.5221 -227.4485 v -217.8634 27.5221 -227.4485
v -251.1589 27.5221 -227.4485 v -251.1589 27.5221 -227.4485
v -217.8634 27.5221 -237.7969 v -217.8634 27.5221 -237.7969
v -251.1589 27.5221 -248.1452 v -251.1589 27.5221 -248.1453
v -217.8634 27.5221 -248.1452 v -217.8634 27.5221 -248.1453
v -251.1589 27.5221 -237.7969 v -251.1589 27.5221 -237.7969
v -253.7229 27.5221 -225.1837 v -253.7229 27.5221 -225.1837
v -215.2771 27.5221 -225.1837 v -215.2771 27.5221 -225.1837
@ -727,7 +727,7 @@ vt 0.4989 0.0003 0.0000
o 10kV_JSX_4_hwg o 10kV_JSX_4_hwg
g 10kV_JSX_4_hwg g 10kV_JSX_4_hwg
usemtl Tex_equipment_DianXiang_a usemtl 10kV_hwg
s 2 s 2
f 37/69/205 38/70/206 39/71/207 f 37/69/205 38/70/206 39/71/207
f 39/71/208 40/72/209 37/69/210 f 39/71/208 40/72/209 37/69/210

View File

@ -0,0 +1,17 @@
# 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware
# File Created: 31.01.2023 10:21:51
newmtl Material__377
Kd 0.0000 0.0000 0.0157
Ks 1.0000 1.0000 1.0000
Tr 0.0000
d 1.0000
Tf 1.0000 1.0000 1.0000
Pr 0.0000
Pm 0.0000
Pc 0.0000
Pcr 0.0000
Ni 1.5200
Ke 0.0000 0.0000 0.0000
illum 2
map_Kd back.jpg

View File

@ -0,0 +1,69 @@
# 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware
# File Created: 31.01.2023 10:21:51
mtllib BackGround.mtl
#
# object Plane001
#
v -5000.0000 -0.0005 -5000.0000
v -5000.0000 -0.0005 5000.0000
v -813.2837 -0.0005 682.5708
v -635.9297 -0.0005 -850.2510
v 5000.0000 -0.0005 5000.0000
v 635.9297 -0.0005 850.2510
v 5000.0000 -0.0005 -5000.0000
v 813.2837 -0.0005 -682.5708
# 8 vertices
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
# 24 vertex normals
vt -1.5000 2.5000 0.5000
vt -1.5000 -1.5000 0.5000
vt 0.1747 0.2270 0.5000
vt 0.2456 0.8401 0.5000
vt 2.5000 -1.5000 0.5000
vt 0.7544 0.1599 0.5000
vt 2.5000 2.5000 0.5000
vt 0.8253 0.7730 0.5000
# 8 texture coords
o Plane001
g Plane001
usemtl Material__377
s off
f 1/1/1 2/2/2 3/3/3
f 3/3/4 4/4/5 1/1/6
f 2/2/7 5/5/8 6/6/9
f 6/6/10 3/3/11 2/2/12
f 5/5/13 7/7/14 8/8/15
f 8/8/16 6/6/17 5/5/18
f 7/7/19 1/1/20 4/4/21
f 4/4/22 8/8/23 7/7/24
# 8 faces

View File

@ -1,19 +1,5 @@
# 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware # 3ds Max Wavefront OBJ Exporter v0.99 - (c)2007 guruware
# File Created: 14.01.2023 10:11:09 # File Created: 31.01.2023 09:49:52
newmtl 金属_铝板
Kd 0.0360 0.0360 0.0360
Ks 1.0000 1.0000 1.0000
Tr 0.0000
d 1.0000
Tf 1.0000 1.0000 1.0000
Pr 0.0000
Pm 0.0000
Pc 0.0000
Pcr 0.0000
Ni 1.5200
Ke 0.0000 0.0000 0.0000
illum 2
newmtl _Color_Adgsdgd newmtl _Color_Adgsdgd
Kd 0.5000 0.5000 0.5000 Kd 0.5000 0.5000 0.5000
@ -30,16 +16,31 @@ newmtl _Color_Adgsdgd
illum 2 illum 2
map_Kd bumpbee_Mercedes_S-Class.jpg map_Kd bumpbee_Mercedes_S-Class.jpg
newmtl 06___Defaultsfvsvzv newmtl JiGui233
Ns 10.0000 Kd 0.5000 0.5000 0.5000
Ni 1.5000 Ks 1.0000 1.0000 1.0000
d 1.0000
Tr 0.0000 Tr 0.0000
Tf 1.0000 1.0000 1.0000 d 1.0000
illum 2 Tf 1.0000 1.0000 1.0000
Ka 0.5882 0.5882 0.5882 Pr 0.0000
Kd 0.5882 0.5882 0.5882 Pm 0.0000
Ks 0.0000 0.0000 0.0000 Pc 0.0000
Pcr 0.0000
Ni 1.5200
Ke 0.0000 0.0000 0.0000 Ke 0.0000 0.0000 0.0000
map_Ka 机柜233.jpg illum 2
map_Kd 机柜233.jpg map_Kd JiGui233.jpg
newmtl ½ðÊô_ÂÁ°å
Kd 0.0360 0.0360 0.0360
Ks 1.0000 1.0000 1.0000
Tr 0.0000
d 1.0000
Tf 1.0000 1.0000 1.0000
Pr 0.0000
Pm 0.0000
Pc 0.0000
Pcr 0.0000
Ni 1.5200
Ke 0.0000 0.0000 0.0000
illum 2

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

View File

@ -70,12 +70,11 @@
models: {}, models: {},
modulesFiles: [], modulesFiles: [],
modelResource: [], modelResource: [],
modelUrl: '' modelUrl: '',
} }
}, },
mounted() { mounted() {
this.staticArr() this.staticArr()
this.host()
}, },
methods: { methods: {
staticArr() { staticArr() {
@ -140,7 +139,7 @@
this.getData() this.getData()
} }
}else{ }else{
this.modulesFiles = ['10kV_hwg','BJ','DL','JG','UPS','XG','YJDY_Car'] this.modulesFiles = ['10kV_hwg','BJ','DL','JG','UPS','XG','YJDY_Car','BackGround']
this.modulesFiles.forEach((item, index) => { this.modulesFiles.forEach((item, index) => {
var obj = { var obj = {
cId: 1, cId: 1,
@ -166,12 +165,12 @@
this.modelResource.push(obj) this.modelResource.push(obj)
}) })
this.modelUrl = 'baoDianHall/BD_export/' this.modelUrl = 'baoDianHall/BD_export/'
if (this.modulesFiles.length == 7) { if (this.modulesFiles.length == 8) {
this.getData() this.getData()
} }
} }
}, },
// 爆炸 // 爆炸
nodeAnimation(node, to, axis, duration, completeCallback, followNodes) { nodeAnimation(node, to, axis, duration, completeCallback, followNodes) {
@ -273,6 +272,7 @@
// 渲染模型依赖renderSingle() // 渲染模型依赖renderSingle()
renderRealData() { renderRealData() {
// 实体状态看板计时器 // 实体状态看板计时器
let that = this;
this.rawS3 = null; this.rawS3 = null;
this.dm = new ht.DataModel(); // 创建数据容器 this.dm = new ht.DataModel(); // 创建数据容器
@ -303,7 +303,9 @@
// 设置图元可见性,内部循环 // 设置图元可见性,内部循环
return data.cVisible; return data.cVisible;
}); });
//显示仰望视角
this.g3d.setRotateMaxPhi(Math.PI * 5 / 12);
// this.g3d.setZoomable(false);
// 设置背景图片 // 设置背景图片
// this.g3d.showDebugTip(true); // 开启Debug面板 // this.g3d.showDebugTip(true); // 开启Debug面板
this.g3d.addInteractorListener((e) => { this.g3d.addInteractorListener((e) => {
@ -401,8 +403,6 @@
// } // }
// 双击实体 // 双击实体
if (e.kind === "doubleClickData") { if (e.kind === "doubleClickData") {
// console.log('aaaaa');
console.log(e.data);
// this.dataInfo = e.data; // this.dataInfo = e.data;
// this.$emit("equipmentInfo", this.dataInfo); // this.$emit("equipmentInfo", this.dataInfo);
// this.g3d.flyTo(e.data, { // this.g3d.flyTo(e.data, {
@ -420,7 +420,6 @@
val val
}, '*'); }, '*');
} }
} }
// 开始旋转镜头 // 开始旋转镜头
// if (e.kind === 'beginRotate') { // if (e.kind === 'beginRotate') {
@ -435,10 +434,47 @@
// }); // });
// } // }
}); });
// 限制缩放比例 zooMax:最大缩放倍数 zoomMin: 最小缩放倍数 zoom 初始化值
var zoomMax = 30;
var zoomMin = -20;
var zoom = 0;
/*监听鼠标滚轮事件,用于限制模型的缩放比例,因为谷歌和火狐的滚轮事件不同,所以
这边同时监听连个事件
*/
//谷歌浏览器的监听事件
document.addEventListener('mousewheel', controllerZoom);
//火狐浏览器的监听事件
document.addEventListener('DOMMouseScroll', controllerZoom);
function controllerZoom(event) {
var wheelDelta = getWheelDelta(event);
if (wheelDelta > 0) {
if (zoom != zoomMax) {
zoom++;
}
} else {
if (zoom != zoomMin) {
zoom--;
}
}
if (zoom > zoomMin && zoom < zoomMax) {
that.g3d.setZoomable(true)
} else {
that.g3d.setZoomable(false)
if (zoom == 30 && (getQueryString('src') == 1 || getQueryString('src') == 2)) {
let val = 'goThree'
window.parent.postMessage({
val
}, '*'); // * 通配符 匹配所有地址; content 表示传递过去嵌套iframe页面的数据
}
}
}
var getWheelDelta = function (event) {
return event.wheelDelta || (-event.detail * 24);
}
// 渲染模型 // 渲染模型
// 单个导入 // 单个导入
this.renderSingle(); this.renderSingle();
// 以组导入 // 以组导入
// renderAsGroup(realMtl, realObj); // renderAsGroup(realMtl, realObj);
}, },
@ -464,7 +500,6 @@
this.createNode(this.modelResource[j], this.modelarray); this.createNode(this.modelResource[j], this.modelarray);
} }
} }
} }
var redLight = new ht.Light(); var redLight = new ht.Light();
redLight.s({ redLight.s({
@ -540,12 +575,8 @@
// }); // });
this.dm.enableAnimation(); this.dm.enableAnimation();
}, },
host(){
var newPavilion = this.createNode(null,null,this.models[5]).s({ createNode(single, array) {
'note': 'Panel 2',
})
},
createNode(single, array,host) {
if (this.models[single.cId] != undefined) { if (this.models[single.cId] != undefined) {
return; return;
} }
@ -561,8 +592,7 @@
node.cTaskCode = single.taskCode; // 挂载modelResource中的taskCode属性 node.cTaskCode = single.taskCode; // 挂载modelResource中的taskCode属性
node.cState = "正常"; // 挂载modelResource中的state属性待确认 node.cState = "正常"; // 挂载modelResource中的state属性待确认
node.cApp = this; node.cApp = this;
node.doxId = null; // node.setHost(host);
node.setHost(host);
// 在这里挂载更多属性所有挂载的属性建议以c开头便于区分 // 在这里挂载更多属性所有挂载的属性建议以c开头便于区分
node.remove = function () { node.remove = function () {
this.cApp.dm.remove(this); this.cApp.dm.remove(this);
@ -575,7 +605,7 @@
this.s("shape3d.color", v); this.s("shape3d.color", v);
}; };
node.s({ node.s({
shape3d: single.parentName, // 模型类别与obj文件一一对应1 shape3d:single.parentName, // 模型类别与obj文件一一对应1
// 'wf.visible': 'selected', // 线框是否可见 // 'wf.visible': 'selected', // 线框是否可见
// 'wf.color': 'red', // 线框颜色 // 'wf.color': 'red', // 线框颜色
// "shape3d.color":'orange', // 模型着色 // "shape3d.color":'orange', // 模型着色
@ -584,7 +614,6 @@
// "wf.geometry": false, // 是否显示几何体的线条 // "wf.geometry": false, // 是否显示几何体的线条
// "wf.loadQuadWireframe": true, // 是否载入四边面的线框 // "wf.loadQuadWireframe": true, // 是否载入四边面的线框
// "wf.combineTriangle": true, // 线框模型是否合并三角 // "wf.combineTriangle": true, // 线框模型是否合并三角
// "all.transparent": true, // "all.transparent": true,
// 'all.color': 'red', // 'all.color': 'red',
'all.image': '', 'all.image': '',
@ -595,7 +624,7 @@
// 'note.position': 7, // 'note.position': 7,
// 'note.autorotate': 'y', // 'note.autorotate': 'y',
}); });
// node.p3(0,20,0);
// 模型允许的条件下开启线框模式?(需要模型细节,但无法满足加载时间需求) // 模型允许的条件下开启线框模式?(需要模型细节,但无法满足加载时间需求)
// node.s({ // node.s({
// 'shape3d.transparent': true, // 'shape3d.transparent': true,
@ -624,6 +653,7 @@
// node.setScale3d(17, 17, 17); // 模型放大100倍(x, y, z) // node.setScale3d(17, 17, 17); // 模型放大100倍(x, y, z)
this.dm.add(node); // 把node加载到数据容器 this.dm.add(node); // 把node加载到数据容器
this.models[node.cId] = node; this.models[node.cId] = node;
}, },
} }
}) })