diff --git a/src/components/color/index.vue b/src/components/color/index.vue index 5ce4006..3ef4c56 100644 --- a/src/components/color/index.vue +++ b/src/components/color/index.vue @@ -308,7 +308,7 @@ export default { // 自旋转 gsap.to(this.group.rotation, { y: -Math.PI * 2, - duration: 2, + duration: 5, // yoyo: true, // repeat: -1, onUpdate: () => { @@ -316,10 +316,37 @@ export default { // this.params.exposure, // 4.0 // ); - this.render(); + // this.render(); // console.log(this.params.scene); }, }); + // 球体自动 + this.group.children.map((item, index) => { + let op = item.position; + gsap.fromTo( + item.position, + { + x: () => { + return Math.random() * 40 - 20; + }, + y: () => { + return Math.random() * 20 - 10; + }, + z: () => { + return Math.random() * 40 - 20; + }, + }, + { + x: op.x, + y: op.y, + z: op.z, + duration: 5, + onUpdate: () => { + if (index == 1) this.render(); + }, + } + ); + }); // 光闪烁 // gsap.to(this.params, { // exposure: 1.1,