-
Loop undulations to length of comp
Greetings,
I have a comp that is 7sec long with a layer that undulates up and down. I’m having trouble figuring out how to make the undulations loop to the comp length perfectly. I’m using the undulation expression via Dan’s motionscript.com site:
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]Any help with this greatly appreciated!
-Trevor