Linear interpolation / mapping (math) node?

 

Hi all,

I am looking for a node that does the function of linear mapping values.

Basically the same as vvvv's map node:
Linear interpolation / mapping (math) node?


You input a value, which gets proportionately translated according to the source min / source max. And destination min / destination max.

So if..:
Source min: 0
Source max: 1
Destination min: 10
Destination max: 30
then if the input is ...
0, it will output 10
if the input is .5 it will output 20
and if the input is 30 it will output 30.

The same with negative numbers
If i was to map
Source min: 0
Source max: 1
Destination min: 0
Destination max: -100
Then the 0.5 input would be turned into -50.

Is there a simple node for it in aximmtery? I want use it regularly, but cannot find it.

Thanks!

   speakerbee

 
Profile Image
speakerbee
  -  

Ended up building my own:
Linear interpolation / mapping (math) node?


Still curious though whether this is natively implemented into Aximmetry.

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

The Lerp module has similar functionality.

Where A is the Destination minimum, B is the Destination maximum and Factor is the Sensor input:
Linear interpolation / mapping (math) node?

However, the Lerp module has fixed Source Minimum and Maximum values as 0 and 1 (Your examples were with these values, so a single Lerp module might be enough for your needs). To define Source Minimum and Maximum and to fully recreate that linear mapping node, you could use an Unlerp module with the Lerp module, where the following pins will function as:
Linear interpolation / mapping (math) node?

Warmest regards,

 
Profile Image
speakerbee
  -  

Nice, thanks for the answer!

;