以下是一个简单的 AE 弹跳表达式:

amp = .1; // 弹跳幅度
freq = 2; // 弹跳频率
decay = 5; // 弹跳衰减

pos = position;
vel = velocity;

if (pos[1] > 0 && vel[1] <= 0) {
    t = 0;
    y = pos[1];
}

if (vel[1] < 0) {
    t = time - inPoint;
    y = y + vel[1]*amp*Math.sin(freq*t)/Math.exp(decay*t);
}

[pos[0], y]

该表达式使用了以下变量:

  • amp: 弹跳幅度,控制弹跳的高度。
  • freq: 弹跳频率,控制弹跳的快慢。
  • decay: 弹跳衰减,控制弹跳的持续时间。
  • pos: 当前位置。
  • vel: 当前速度。
  • t: 时间变量,用于计算弹跳的周期。
  • y: 弹跳后的垂直坐标。

该表达式首先判断物体是否正在下降,如果正在下降,则计算弹跳的高度和位置。

你可以根据自己的需求调整表达式中的变量值,来创建不同的弹跳效果。

After Effects 弹跳表达式教程:简单易懂的实现方法

原文地址: https://www.cveoy.top/t/topic/m0ly 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录