一些修改
This commit is contained in:
parent
59d1d4c62c
commit
c1d66f0e07
@ -75,7 +75,7 @@ export default {
|
||||
1,
|
||||
200
|
||||
);
|
||||
this.camera.position.set(0, 0, 20);
|
||||
this.camera.position.set(0, 0, 30);
|
||||
this.camera.lookAt(0, 0, 0);
|
||||
|
||||
// 定义操控
|
||||
@ -85,7 +85,7 @@ export default {
|
||||
);
|
||||
this.controls.maxPolarAngle = Math.PI * 0.5;
|
||||
this.controls.minDistance = 1;
|
||||
this.controls.maxDistance = 100;
|
||||
this.controls.maxDistance = 200;
|
||||
this.controls.addEventListener("change", this.render);
|
||||
|
||||
// 添加全局环境光
|
||||
@ -198,10 +198,14 @@ export default {
|
||||
);
|
||||
if (this.intersects.length > 0) {
|
||||
const object = this.intersects[0].object;
|
||||
// gsap.to(object.material, {
|
||||
// opacity: 0,
|
||||
// onUpdate: () => {},
|
||||
// });
|
||||
gsap.to(object.scale, {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0,
|
||||
onUpdate: () => {
|
||||
this.render();
|
||||
},
|
||||
});
|
||||
object.layers.toggle(this.BLOOM_SCENE);
|
||||
this.render();
|
||||
}
|
||||
@ -232,17 +236,17 @@ export default {
|
||||
|
||||
const material = new THREE.MeshBasicMaterial({ color: color });
|
||||
const sphere = new THREE.Mesh(geometry, material);
|
||||
sphere.position.x = Math.random() * 100 - 50;
|
||||
sphere.position.y = Math.random() * 100 - 50;
|
||||
sphere.position.z = Math.random() * 100 - 50;
|
||||
sphere.position.x = Math.random() * 30 - 15;
|
||||
sphere.position.y = Math.random() * 30 - 15;
|
||||
sphere.position.z = Math.random() * 30 - 15;
|
||||
sphere.position
|
||||
.normalize()
|
||||
.multiplyScalar(Math.random() * 4.0 + 2.0);
|
||||
.multiplyScalar(Math.random() * 5.0 + 2.5);
|
||||
sphere.scale.setScalar(Math.random() * Math.random() + 0.5);
|
||||
this.scene.add(sphere);
|
||||
|
||||
if (Math.random() < 0.25)
|
||||
sphere.layers.enable(this.BLOOM_SCENE);
|
||||
// if (Math.random() < 0.25)
|
||||
sphere.layers.enable(this.BLOOM_SCENE);
|
||||
|
||||
this.group.add(sphere);
|
||||
}
|
||||
@ -317,20 +321,20 @@ export default {
|
||||
},
|
||||
});
|
||||
// 光闪烁
|
||||
gsap.to(this.params, {
|
||||
exposure: 1.2,
|
||||
duration: 2,
|
||||
yoyo: true,
|
||||
repeat: -1,
|
||||
onUpdate: () => {
|
||||
this.renderer.toneMappingExposure = Math.pow(
|
||||
this.params.exposure,
|
||||
4.0
|
||||
);
|
||||
this.render();
|
||||
// console.log(this.params.scene);
|
||||
},
|
||||
});
|
||||
// gsap.to(this.params, {
|
||||
// exposure: 1.1,
|
||||
// duration: 2,
|
||||
// yoyo: true,
|
||||
// repeat: -1,
|
||||
// onUpdate: () => {
|
||||
// this.renderer.toneMappingExposure = Math.pow(
|
||||
// this.params.exposure,
|
||||
// 4.0
|
||||
// );
|
||||
// this.render();
|
||||
// // console.log(this.params.scene);
|
||||
// },
|
||||
// });
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -113,8 +113,8 @@ export default {
|
||||
// 第一个游戏
|
||||
if (id == 1) {
|
||||
this.$router.push({
|
||||
path: "/color",
|
||||
query: {},
|
||||
name: "Color",
|
||||
params: {},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -20,7 +20,7 @@ const routes = [
|
||||
component: Home,
|
||||
meta: {
|
||||
title: "大板栗的玩具屋", // 标题
|
||||
keepAlive: true, // 是否保持活跃
|
||||
keepAlive: false, // 是否保持活跃
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -29,7 +29,7 @@ const routes = [
|
||||
component: Home,
|
||||
meta: {
|
||||
title: "大板栗的玩具屋", // 标题
|
||||
keepAlive: true, // 是否保持活跃
|
||||
keepAlive: false, // 是否保持活跃
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -38,7 +38,7 @@ const routes = [
|
||||
component: Color,
|
||||
meta: {
|
||||
title: "鉴色", // 标题
|
||||
keepAlive: true, // 是否保持活跃
|
||||
keepAlive: false, // 是否保持活跃
|
||||
},
|
||||
},
|
||||
// {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user