Converter: Map Range
|Function||Remaps a number so that it falls within a specified range|
|Nearest C4D equivalent||Xpresso Range Mapper node|
Suppose you have a range of values - the radius of particles, for example. You know that these values range from 1 to 10. You'd like to use them as an input to some other node - e.g. the Fac input of a Color Ramp node. But that value needs to be in the range 0 to 1. How do you convert the radius into such a value?
This is the purpose of the Map Range node. You first specify the range the values currently have - in the above example, that would be 1 to 10. Then you specify the range you would like them to have - in this example, 0 to 1. You set these values into the node and the remapped result is output.
Be aware that the ranges might not output exactly what you might think. In the above example, a radius of 1 would be output as zero; a radius of 10 would be output as 1. That is as expected. For a radius of 5 you might expect it would be output as 0.5, but actually it would be 0.444 recurring. This is unlikely to cause any problems unless you are testing for specific values.
Note: a * symbol next to the name indicates the parameter also has an input port. A # symbol indicates that the parameter can only be changed with an input node, not in the node itself.
Interpolation type drop-down menu
The node has a variety of algorithms for calculating the remapped value. The default is Linear, which produces a straight correspondence between the original and remapped values. Stepped Linear will quantize the result, so producing a stepped interpolation. The other algorithms produce smoothed interpolation between values.
The options are:
- Stepped Linear
- Smooth Step
- Smoother Step
Suppose you specify that the current range of values is from 1 to 10. What happens if a value falls outside this range?
If this switch is checked, the output result is clamped between the 'To Min' and 'To Max' values - that is, it will not fall outside these values. If the switch is unchecked, it may do so, which may or may not matter, depending on what you are doing with the result.
The value to be remapped'.
From Min *, From Max *
The current range of values that 'Value' will fall within.
To Min *, To Max *
The desired range of values that 'Value' will have after remapping.
The remapped value.