-
Separate width and height in scale expression
Hi, I”m sure some of you are familiar with this expression to animate scale at a layer marker from the Adobe website:
n = 0;
t = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n–;
}
if (n > 0) t = time – marker.key(n).time;amp = 15;
freq = 5;
decay = 3.0;angle = freq * 2 * Math.PI * t;
scaleFact = (100 + amp * Math.sin(angle) / Math.exp(decay * t)) / 100;
[value[0] * scaleFact, value[1] / scaleFact];Well, what I’d like to do is to be able to control the width and height element of this expression separately – so that the object squashes more than it stretches. I have the other parameters set up as sliders, and I’d like to add a couple more – one each for width and height.
Anyone feeling mathematical?
Mac Pro, 10.5.8, 2×2.66GHz, 6GB RAM, GeForce 8800GT 512MB