1 2 3 4 5 6 7 8 9 10 11 |
amp = 50; // 缩放振幅,放大(缩小)50% freq = 2; // 缩放频率,2次/秒 seedRandom(index, true); s = thisLayer.scale; maxScale = Math.max(s[0], Math.max(s[1], s[2])); randomScale = amp * (Math.sin(freq * time) + 1) / 2; // 使用正弦函数生成随机缩放值 [s[0] * (1 + randomScale/maxScale), s[1] * (1 + randomScale/maxScale), s[2] * (1 + randomScale/maxScale)] |
近期评论