Compare commits

..

2 Commits

Author SHA1 Message Date
瓶中沙 25024e4f47 123 2024-01-14 23:33:39 +08:00
瓶中沙 04dd0c7deb 123 2024-01-14 20:52:35 +08:00
3 changed files with 18480 additions and 12 deletions

BIN
dist.zip Normal file

Binary file not shown.

18426
public/jzc/jz1.gltf Normal file

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,16 @@
<span class="red"></span>大于3年 <span class="red"></span>大于3年
</p> </p>
</div> </div>
<!-- <div class="stop_tooltips" v-show="isShowstart" @click="stop">
<p>
停止
</p>
</div>
<div class="con_tooltips" v-show="isShowstart" @click="continu">
<p>
继续
</p>
</div> -->
</div> </div>
</template> </template>
<script setup> <script setup>
@ -73,7 +83,7 @@ onMounted(() => {
}); });
// document.addEventListener("mousemove", onMouseMove); // document.addEventListener("mousemove", onMouseMove);
}); });
let scene, renderer, camera, controls, clickedObject, model; let scene, renderer, camera, controls, clickedObject, model, animal1, animal2;
// //
let objArr = []; let objArr = [];
@ -91,9 +101,10 @@ let labelRenderer = new CSS2DRenderer(); //新建CSS2DRenderer
const data = reactive({ const data = reactive({
isAddLabel: true, isAddLabel: true,
isRemoveBottom: true, isRemoveBottom: true,
isShowWall: false // isShowWall: false, //
isShowstart: false
}); });
const { isAddLabel, isRemoveBottom, isShowWall } = toRefs(data); const { isAddLabel, isRemoveBottom, isShowWall, isShowstart } = toRefs(data);
// //
Bus.on('clickBuild', (isParent) => { Bus.on('clickBuild', (isParent) => {
// Todo // Todo
@ -148,6 +159,7 @@ const init = () => {
document.getElementById('gltf').appendChild(renderer.domElement); document.getElementById('gltf').appendChild(renderer.domElement);
controls = new OrbitControls(camera, renderer.domElement); controls = new OrbitControls(camera, renderer.domElement);
controls.minDistance = 15;
const pmremGenerator = new THREE.PMREMGenerator(renderer); const pmremGenerator = new THREE.PMREMGenerator(renderer);
scene.environment = pmremGenerator.fromScene(new RoomEnvironment()).texture; scene.environment = pmremGenerator.fromScene(new RoomEnvironment()).texture;
var vector = new THREE.Vector3(); var vector = new THREE.Vector3();
@ -430,6 +442,7 @@ const toHomeView = () => {
cleanColor(); cleanColor();
// //
isShowWall.value = false; isShowWall.value = false;
isShowstart.value = false;
// //
removexf(); removexf();
} }
@ -452,6 +465,7 @@ const nearCamera = (floor) => {
const setLabel = () => { const setLabel = () => {
if (isAddLabel.value) { if (isAddLabel.value) {
let obj = scene.getObjectByName('T11'); let obj = scene.getObjectByName('T11');
console.log(123, obj)
addLabel(obj, 'title'); addLabel(obj, 'title');
} else { } else {
removeLabel(); removeLabel();
@ -610,6 +624,7 @@ const removexf = () => {
const changeMap = (img) => { const changeMap = (img) => {
removeLabel(); removeLabel();
isShowWall.value = true; isShowWall.value = true;
isShowstart.value = false;
// //
model.traverse(e => { model.traverse(e => {
if (['touliao_wall1', 'touliao_wall2', 'touliao_wall3', 'touliao_wall4', 'touliao_wall5', 'touliao_wall6', 'touliao_wall7', 'touliao_wall8'].indexOf(e.name) != -1) { if (['touliao_wall1', 'touliao_wall2', 'touliao_wall3', 'touliao_wall4', 'touliao_wall5', 'touliao_wall6', 'touliao_wall7', 'touliao_wall8'].indexOf(e.name) != -1) {
@ -642,6 +657,8 @@ const changeMap = (img) => {
} }
// //
const check = () => { const check = () => {
isShowstart.value = true;
isShowWall.value = false;
removeLabel(); removeLabel();
let yn = 8, duration = 0; let yn = 8, duration = 0;
if (checkindex < checkArr.length ) { if (checkindex < checkArr.length ) {
@ -659,18 +676,19 @@ const check = () => {
duration = 10 duration = 10
} }
// 2 // 2
gsap.to(controls.target, { animal1 = gsap.to(controls.target, {
x: nextObj.x, x: nextObj.x,
y: nextObj.y + 2, y: nextObj.y,
z: nextObj.z, z: nextObj.z,
duration: duration, duration: duration,
ease: "power1.inOut", ease: "power1.inOut",
onComplete: () => { onComplete: () => {
controls.enabled = false;
// 3 // 3
gsap.to(camera.position, { animal2 = gsap.to(camera.position, {
x: nextObj.x-0.5, x: nextObj.x + 2,
y: nextObj.y + yn, y: nextObj.y + 6,
z: nextObj.z, z: nextObj.z + 4,
duration: 10, duration: 10,
ease: 'power1.inOut', ease: 'power1.inOut',
onComplete: () => { onComplete: () => {
@ -698,7 +716,14 @@ const checkComplete = () => {
emit('checkComplete', checkArr); emit('checkComplete', checkArr);
return; return;
} }
const stop = () => {
animal1.pause();
animal2.pause();
}
const continu = () => {
animal1.resume();
animal2.resume();
}
</script> </script>
<style lang='scss'> <style lang='scss'>
#gltf { #gltf {
@ -854,6 +879,24 @@ const checkComplete = () => {
} }
} }
} }
.stop_tooltips, .con_tooltips {
position: absolute;
bottom: 50px;
right: 500px;
z-index: 999;
display: flex;
color: #fff;
width: 50px;
height: 50px;
border-radius: 50%;
justify-content: space-around;
align-items: center;
background: #3cbfdf;
cursor: pointer;
}
.con_tooltips {
right: 560px;
}
@keyframes textAnimation { @keyframes textAnimation {
0% { 0% {
transform: scale(1); transform: scale(1);
@ -873,8 +916,7 @@ const checkComplete = () => {
color: #141313; color: #141313;
padding: 15px; padding: 15px;
text-align: center; text-align: center;
line-height: 100px; line-height: 80px;
border-radius: 5px;
border-radius: 50%; border-radius: 50%;
.text{ .text{
display: inline-block; display: inline-block;