-
Using Sine to drive Opacity, but between a range of values
I basically have a shadow underneath a hovering object that I want to increase and decrease in opacity as a function of a sin wave. The hovering object already has this expression on it’s y position:
amp = 5;
freq = .75;y = amp*Math.sin(time*freq*Math.PI*2);
value + [0,y,0]The tricky part is, getting the max and min values to fall between something like 20 and 50. I understand it might be done with something like a clamp, but I don’t understand the syntax.
Thanks