|
|
@ -109,24 +109,28 @@ export default {
|
|
|
|
appsecret: 'rXmhoLAiOPNKzbl7g2qxCV8tFwRdYuZM'
|
|
|
|
appsecret: 'rXmhoLAiOPNKzbl7g2qxCV8tFwRdYuZM'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const viewer = new AMRT.Viewer('container', param)
|
|
|
|
const viewer = new AMRT.Viewer('container', param)
|
|
|
|
console.log(AMRT)
|
|
|
|
console.log(viewer)
|
|
|
|
|
|
|
|
console.log(viewer.core)
|
|
|
|
|
|
|
|
console.log(viewer.core?.Object3D)
|
|
|
|
|
|
|
|
// const gui = new dat.GUI()
|
|
|
|
|
|
|
|
// console.log(gui)
|
|
|
|
let num = 0
|
|
|
|
let num = 0
|
|
|
|
let modelArr = [
|
|
|
|
let modelArr = [
|
|
|
|
// '1720315475507941376',
|
|
|
|
'1720315475507941376',
|
|
|
|
// '1720315479907766272',
|
|
|
|
'1720315479907766272',
|
|
|
|
// '1720315484513112064',
|
|
|
|
'1720315484513112064',
|
|
|
|
// '1720315500866703360',
|
|
|
|
'1720315500866703360',
|
|
|
|
// '1720315558030872576',
|
|
|
|
'1720315558030872576',
|
|
|
|
// '1720315596551360512',
|
|
|
|
'1720315596551360512',
|
|
|
|
// '1720315644550975488',
|
|
|
|
'1720315644550975488',
|
|
|
|
// '1720315648946606080',
|
|
|
|
'1720315648946606080',
|
|
|
|
// '1720315687114772480',
|
|
|
|
'1720315687114772480',
|
|
|
|
// '1720315691422322688',
|
|
|
|
'1720315691422322688',
|
|
|
|
// '1720315722275622912',
|
|
|
|
'1720315722275622912',
|
|
|
|
// '1720315729129115648',
|
|
|
|
'1720315729129115648',
|
|
|
|
// '1720315768454909952',
|
|
|
|
'1720315768454909952',
|
|
|
|
// '1720316275214913536',
|
|
|
|
'1720316275214913536',
|
|
|
|
// '1720316297822212096',
|
|
|
|
'1720316297822212096',
|
|
|
|
]
|
|
|
|
]
|
|
|
|
modelArr.forEach(e => {
|
|
|
|
modelArr.forEach(e => {
|
|
|
|
let model = viewer.loadModel(e, {
|
|
|
|
let model = viewer.loadModel(e, {
|
|
|
@ -139,21 +143,30 @@ export default {
|
|
|
|
alert('加载完成');
|
|
|
|
alert('加载完成');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.on('click', function () {
|
|
|
|
m.on('click', function () {
|
|
|
|
// console.log(this)
|
|
|
|
console.log(m)
|
|
|
|
// console.log(m)
|
|
|
|
console.log(e)
|
|
|
|
// let clickModel = model.getObjectById(this)
|
|
|
|
console.log(m.getObjectById)
|
|
|
|
// console.log(clickModel)
|
|
|
|
|
|
|
|
// alert(`${e}`)
|
|
|
|
|
|
|
|
// viewer.operator.restore()
|
|
|
|
|
|
|
|
// viewer.operator.translucenceOthers(this.viewer)
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// viewer.container.addEventListener( 'click', e => {
|
|
|
|
|
|
|
|
// //通过鼠标拾取模型对象
|
|
|
|
|
|
|
|
// let object = viewer.picker.intersectObject( e )
|
|
|
|
|
|
|
|
// if( object ){
|
|
|
|
|
|
|
|
// console.log( '当前选中模型', object.object )
|
|
|
|
|
|
|
|
// viewer.operator.restore()
|
|
|
|
|
|
|
|
// viewer.operator.translucenceOthers(object)
|
|
|
|
|
|
|
|
// viewer.operator.translucenceOthers(object.object)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
viewer.controls.setTarget(26.3, -19.8, -82)
|
|
|
|
viewer.controls.setTarget(26.3, -19.8, -82)
|
|
|
|
viewer.controls.setPosition(31, 1721, 584)
|
|
|
|
viewer.controls.setPosition(31, 1721, 584)
|
|
|
|
viewer.operator.enabled = true
|
|
|
|
viewer.operator.enabled = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 灯光
|
|
|
|
|
|
|
|
viewer.sceneManager.setLightness(1)
|
|
|
|
|
|
|
|
|
|
|
|
// viewer.controls.startAutoRotate(1)
|
|
|
|
// viewer.controls.startAutoRotate(1)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|