-
have problem with gravity depending on index layer
Hi all!
How i can pick this expression(gravity) with time depend on index layers.
y=720*Math.abs(Math.cos(2*time*Math.PI))*Math.exp(-time*0.7);
position-[0,y]
When i try pick trig function to time depend on index layer, trig return argument of function from global time.I found 2 ways, but it is not working correct:
//1//
t = Math.min(Math.floor(time),index);y=720*Math.abs(Math.cos(2*time*Math.PI))*t*Math.exp(-time*0.7);
position-[0,y]
////2//
if (time >index){
y=720*Math.abs(Math.cos(2*time*Math.PI))*t*Math.exp(-time*0.7);}position-[0,y]
//