一些修改

This commit is contained in:
rucky 2021-10-14 18:15:41 +08:00
parent 59d1d4c62c
commit c1d66f0e07
3 changed files with 35 additions and 31 deletions

View File

@ -75,7 +75,7 @@ export default {
1, 1,
200 200
); );
this.camera.position.set(0, 0, 20); this.camera.position.set(0, 0, 30);
this.camera.lookAt(0, 0, 0); this.camera.lookAt(0, 0, 0);
// //
@ -85,7 +85,7 @@ export default {
); );
this.controls.maxPolarAngle = Math.PI * 0.5; this.controls.maxPolarAngle = Math.PI * 0.5;
this.controls.minDistance = 1; this.controls.minDistance = 1;
this.controls.maxDistance = 100; this.controls.maxDistance = 200;
this.controls.addEventListener("change", this.render); this.controls.addEventListener("change", this.render);
// //
@ -198,10 +198,14 @@ export default {
); );
if (this.intersects.length > 0) { if (this.intersects.length > 0) {
const object = this.intersects[0].object; const object = this.intersects[0].object;
// gsap.to(object.material, { gsap.to(object.scale, {
// opacity: 0, x: 0,
// onUpdate: () => {}, y: 0,
// }); z: 0,
onUpdate: () => {
this.render();
},
});
object.layers.toggle(this.BLOOM_SCENE); object.layers.toggle(this.BLOOM_SCENE);
this.render(); this.render();
} }
@ -232,17 +236,17 @@ export default {
const material = new THREE.MeshBasicMaterial({ color: color }); const material = new THREE.MeshBasicMaterial({ color: color });
const sphere = new THREE.Mesh(geometry, material); const sphere = new THREE.Mesh(geometry, material);
sphere.position.x = Math.random() * 100 - 50; sphere.position.x = Math.random() * 30 - 15;
sphere.position.y = Math.random() * 100 - 50; sphere.position.y = Math.random() * 30 - 15;
sphere.position.z = Math.random() * 100 - 50; sphere.position.z = Math.random() * 30 - 15;
sphere.position sphere.position
.normalize() .normalize()
.multiplyScalar(Math.random() * 4.0 + 2.0); .multiplyScalar(Math.random() * 5.0 + 2.5);
sphere.scale.setScalar(Math.random() * Math.random() + 0.5); sphere.scale.setScalar(Math.random() * Math.random() + 0.5);
this.scene.add(sphere); this.scene.add(sphere);
if (Math.random() < 0.25) // if (Math.random() < 0.25)
sphere.layers.enable(this.BLOOM_SCENE); sphere.layers.enable(this.BLOOM_SCENE);
this.group.add(sphere); this.group.add(sphere);
} }
@ -317,20 +321,20 @@ export default {
}, },
}); });
// //
gsap.to(this.params, { // gsap.to(this.params, {
exposure: 1.2, // exposure: 1.1,
duration: 2, // duration: 2,
yoyo: true, // yoyo: true,
repeat: -1, // repeat: -1,
onUpdate: () => { // onUpdate: () => {
this.renderer.toneMappingExposure = Math.pow( // this.renderer.toneMappingExposure = Math.pow(
this.params.exposure, // this.params.exposure,
4.0 // 4.0
); // );
this.render(); // this.render();
// console.log(this.params.scene); // // console.log(this.params.scene);
}, // },
}); // });
}, },
}, },
}; };

View File

@ -113,8 +113,8 @@ export default {
// //
if (id == 1) { if (id == 1) {
this.$router.push({ this.$router.push({
path: "/color", name: "Color",
query: {}, params: {},
}); });
} }
}, },

View File

@ -20,7 +20,7 @@ const routes = [
component: Home, component: Home,
meta: { meta: {
title: "大板栗的玩具屋", // 标题 title: "大板栗的玩具屋", // 标题
keepAlive: true, // 是否保持活跃 keepAlive: false, // 是否保持活跃
}, },
}, },
{ {
@ -29,7 +29,7 @@ const routes = [
component: Home, component: Home,
meta: { meta: {
title: "大板栗的玩具屋", // 标题 title: "大板栗的玩具屋", // 标题
keepAlive: true, // 是否保持活跃 keepAlive: false, // 是否保持活跃
}, },
}, },
{ {
@ -38,7 +38,7 @@ const routes = [
component: Color, component: Color,
meta: { meta: {
title: "鉴色", // 标题 title: "鉴色", // 标题
keepAlive: true, // 是否保持活跃 keepAlive: false, // 是否保持活跃
}, },
}, },
// { // {