-
Bobbing in Water REDUX REDUX
The expressions I am using..
on positionxAmp = 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);//–NEW
swayAmp = 100; //amplitude of sway
swayFreq = .25; //frequency of sway
x = swayAmp * Math.sin(time * swayFreq);//—–
value + [x,y]on rotation
xFreq = .3; //undulations per second
xSpeed = 150; //speed of wave (pixels per second)
damping = 15; //undulation damping factorwl = xSpeed/xFreq; //wavelength (pixels)
phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
theta = Math.atan(Math.cos(2*Math.PI*xFreq*time + phaseOffset));
radiansToDegrees(theta)/damping;Is there any way to make the upward motion be faster than the downward motion? Say 50% faster?
Any help is much appreciated.