Page 1 of 1

Bouncing Ball expression problem

Posted: June 11th, 2019, 8:32 pm
by youkaze
I created a bouncing ball animation, the expression effect like this:

Image

The wrong codeļ¼š

Code: Select all

yf = 2.5;
yd = 3;
yamp = 600;

cos = Math.cos(yf*time*2*Math.PI)/Math.exp(yd*time);
elevcos = Math.abs(cos);
y = yamp * elevcos;

xf = 2.5;
xd = 1;
xamp = -400;

sin = Math.sin(yf*time*2*Math.PI)/Math.exp(yd*time);
elevsin = Math.abs(sin);
x = xamp * elevsin;

[value[0]-x,value[1]-y]


I guess the problem is related to the X-axis sin function, but I don't know how to solve it, if anybody know the problem please let me know, thank you guys very much!