|
|
|
@ -37,6 +37,33 @@
|
|
|
|
|
<el-button type="primary" @click="tuopanReset">托盘复位</el-button>
|
|
|
|
|
<el-button type="primary" @click="tuopanOut">托盘推出</el-button>
|
|
|
|
|
<el-button type="primary" @click="removetuopan">删除托盘</el-button>
|
|
|
|
|
<el-select v-model="tuopanFloor" placeholder="去几楼" @change="toFloor">
|
|
|
|
|
<el-option
|
|
|
|
|
label="1楼"
|
|
|
|
|
:value="1"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
<el-option
|
|
|
|
|
label="2楼"
|
|
|
|
|
:value="2"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
<el-option
|
|
|
|
|
label="3楼"
|
|
|
|
|
:value="3"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
<el-option
|
|
|
|
|
label="4楼"
|
|
|
|
|
:value="4"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
<el-option
|
|
|
|
|
label="5楼"
|
|
|
|
|
:value="5"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button type="primary" @click="addtuopan">添加托盘</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -49,17 +76,18 @@ import * as TWEEN from '@tweenjs/tween.js'
|
|
|
|
|
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js'
|
|
|
|
|
import { MTLLoader } from 'three/examples/jsm/loaders/MTLLoader.js'
|
|
|
|
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
|
|
|
|
|
import { CSS2DObject, CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer'
|
|
|
|
|
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer'
|
|
|
|
|
import Demo from '@/components/model/demo.vue'
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
tuopanInishengji,
|
|
|
|
|
addtuopan,
|
|
|
|
|
storeyHeight,
|
|
|
|
|
storeyWidth,
|
|
|
|
|
tishengjiAnimation,
|
|
|
|
|
tuopanInishengji,
|
|
|
|
|
tuopanLocation,
|
|
|
|
|
tuopanXAnimation,
|
|
|
|
|
tuopanYAnimation,
|
|
|
|
|
tuopanLocation
|
|
|
|
|
tuopanYAnimation
|
|
|
|
|
} from './animation'
|
|
|
|
|
|
|
|
|
|
let keyidongModel = null
|
|
|
|
@ -93,7 +121,8 @@ export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
num: -60,
|
|
|
|
|
floor: 1
|
|
|
|
|
floor: 1,
|
|
|
|
|
tuopanFloor:1,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
@ -146,8 +175,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (v === 'tishengji_tuopan') {
|
|
|
|
|
tuopanModel = object
|
|
|
|
|
// tuopanModel.position.y = storeyHeight[5]
|
|
|
|
|
// tuopanModel.position.x = this.num
|
|
|
|
|
}
|
|
|
|
|
// 更新渲染器
|
|
|
|
|
renderer.render(scene, camera)
|
|
|
|
@ -230,12 +257,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
requestAnimationFrame(animate)
|
|
|
|
|
TWEEN.update()
|
|
|
|
|
if (keyidongModel) {
|
|
|
|
|
// keyidongModel.position.y += 0.1;
|
|
|
|
|
}
|
|
|
|
|
if (tuopanModel) {
|
|
|
|
|
// tuopanModel.position.y += 0.1;
|
|
|
|
|
}
|
|
|
|
|
renderer.render(scene, camera)
|
|
|
|
|
labelRenderer.render(scene, camera)
|
|
|
|
|
}
|
|
|
|
@ -245,6 +266,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
animate()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleChange() {
|
|
|
|
@ -267,9 +289,13 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
removetuopan() {
|
|
|
|
|
scene.remove(tuopanModel)
|
|
|
|
|
tuopanModel = null
|
|
|
|
|
},
|
|
|
|
|
addtuopan() {
|
|
|
|
|
scene.add(tuopanModel)
|
|
|
|
|
async addtuopan() {
|
|
|
|
|
tuopanModel = await addtuopan({ scene })
|
|
|
|
|
tuopanModel.position.x= storeyWidth[this.tuopanFloor]
|
|
|
|
|
tuopanLocation.floor = 1
|
|
|
|
|
tuopanLocation.x = storeyWidth[this.tuopanFloor]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|