修改模型

master
夜笙歌 1 year ago
parent 8a77e596e2
commit e60b379e97

@ -28,12 +28,12 @@ export default {
}, },
async mounted() { async mounted() {
await isAMRT() await isAMRT()
console.log(AMRT)
const param = { const param = {
appkey: 'aveMPyNWzDJm', appkey: 'aveMPyNWzDJm',
appsecret: 'rXmhoLAiOPNKzbl7g2qxCV8tFwRdYuZM' appsecret: 'rXmhoLAiOPNKzbl7g2qxCV8tFwRdYuZM'
} }
const viewer = new AMRT.Viewer('container', param) const viewer = new AMRT.Viewer('container', param)
console.log(AMRT)
let num = 0 let num = 0
let modelArr = [ let modelArr = [
'1720315475507941376', '1720315475507941376',
@ -53,20 +53,23 @@ export default {
'1720316297822212096', '1720316297822212096',
] ]
modelArr.forEach(e => { modelArr.forEach(e => {
viewer.loadModel(e, { let model = viewer.loadModel(e, {
background: false, background: false,
focus: false, focus: false,
id:e, id: e,
onComplete: function (m) { onLoad: function (m) {
num += 1 num += 1
if (num === modelArr.length) { if (num === modelArr.length) {
alert('加载完成'); alert('加载完成');
} }
m.on('click', function (){ m.on('click', function () {
console.log(Core.getObjectById ( this.ID )) // console.log(this)
alert(`${e}`) // console.log(m)
viewer.operator.restore() // let clickModel = model.getObjectById(this)
viewer.operator.translucenceOthers(this) // console.log(clickModel)
// alert(`${e}`)
// viewer.operator.restore()
// viewer.operator.translucenceOthers(this.viewer)
}) })
} }
}) })

Loading…
Cancel
Save