ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Continue interpolation of linear expression beyond its paramaters

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Harry Hoag
Continue interpolation of linear expression beyond its paramaters
on Dec 8, 2015 at 3:44:02 pm

Hiya,

I'm using the linear interpolation expression. At the moment the interpolation is clamped when you get to the entered value range, I was wondering if there was a way to make the calculation continue beyond the values?

If anyone uses cinema 4d, the range mapper node in xpresso does this. You simply put in your lower and upper values and then just leave it un-clamped and the calculation will continue beyond your values.

I hope this makes sense, I've included my current expression below.

thanks

input = thisComp.layer("shadow_position").transform.position[0];

inputLow = -238;

inputHigh = 2047;

outputLow = -56;

outputHigh = 63;


linear(input,inputLow,inputHigh,outputLow,outputHigh)


Return to posts index

Xavier Gomez
Re: Continue interpolation of linear expression beyond its paramaters
on Dec 9, 2015 at 7:24:28 am

To avoid clamping, you can use this:

outputLow + (input-inputLow) * (outputHigh-outputLow)/(inputHigh-inputLow);

Xavier


Return to posts index

Michael Szalapski
Re: Continue interpolation of linear expression beyond its paramaters
on Jan 26, 2017 at 9:21:40 pm

Thanks! This was really useful.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]