Skip to content
FREN

Scale a value

Remap maps one range onto another: here, the top of the rev range onto a whole bar.

  • 5 min
  • follows lesson 2
  • at the end: a bar that only lives between 5000 and 8000 rpm

The bar from lesson 2 runs from 0 to 8000 rpm. For shifting, only the top matters: we want it empty at 5000 rpm and full at 8000. That’s Remap’s job.

Step 1 / 3

Slip in a Remap

Hover the graph between the Input and the bar, Tab, Remap. Wire rpm to its in, then its output to the bar’s value: the new wire replaces the old one.

Step 2 / 3

Set both ranges

fromMin 5000 and fromMax 8000: the range read. toMin 0 and toMax 1: the range given back. Click a field to type the value, or drag across it to scroll it.

Step 3 / 3

Bring the maximum down to 1

The bar now gets 0 to 1: change its maximum from 8000 to 1, in the Number node. It stays empty below 5000 rpm, full at 8000.

The revs go through the Remap before the bar. Change the ranges: toMin 1 and toMax 0 give a bar that empties as the revs rise.

Input

rpm

remap

out

Bar

Remap draws a straight line through two points: (fromMin, toMin) and (fromMax, toMax). Every value read lands on that line: 6500 rpm, halfway between 5000 and 8000, gives 0.5.

At 4000 rpm, the output is −0.33. Remap doesn’t clamp: outside the range read, it extends the line. The bar doesn’t care, it stays empty; a text would show the negative. Add Clamp after it.

The output stops moving. fromMin and fromMax are equal: there’s no line left, the node gives back toMin.