Copy link to clipboard
Copied
Greetings community,
i found an expression that makes a floating animation with consistant oscillations.
xAmp = 3; //height of undulations (pixels)
xFreq = .3; //undulations per second
xSpeed = 150; //speed of wave (pixels per second)
wl = xSpeed/xFreq; //wavelength (pixels)
phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
y = xAmp*Math.sin(2*Math.PI*xFreq*time + phaseOffset);
value + [0,y]
This expression does the oscillations only on the Y axes.
My question:
Is there a way to make the expression do the oscillation not just on Y, but also on the X axes at the same time?
Simply re-use the y variable twice in the last line: value + [y,y]. It's not going to look particularly good, though, since it will effectively only "rotate" the effect by 45 degrees. You should duplicate the wave code and use different values for the x coordinates.
Mylenium
Copy link to clipboard
Copied
Simply re-use the y variable twice in the last line: value + [y,y]. It's not going to look particularly good, though, since it will effectively only "rotate" the effect by 45 degrees. You should duplicate the wave code and use different values for the x coordinates.
Mylenium
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more