Vectors & math

Remap Values with fit01 (VEX)

Map a 0..1 value into any range with fit01, and remap signed -1..1 noise with fit11 - the remaps you use in almost every wrangle.

What it does

Remaps a value from a known range into a new one. fit01 assumes the input is 0..1 and maps it into your min and max; fit11 assumes -1..1, which is exactly what signed noise returns.

When to use it

Use it constantly: turning a 0..1 mask, ramp or rand() into a real-world range, or bringing sin() and Perlin noise (which return -1..1) into a usable range with fit11.

The VEX code

// fit01 maps 0..1 -> min..max; fit11 maps -1..1 -> min..max.
f@a = fit01(@P.x, 0, 10);       // careful: @P.x is not guaranteed 0..1
f@b = fit11(sin(@Time), 0, 1);  // sin() is -1..1, so fit11 is correct
Context: paste this into an Attribute Wrangle running over points, unless noted otherwise.

Inputs and assumptions

Common mistakes

Frequently asked questions

What is the difference between fit and fit01 in Houdini?

fit remaps from an explicit input range you provide; fit01 assumes the input is already 0..1, so you only pass the new min and max. Use fit when the input range is arbitrary.

Why is fit11 used with noise and sin()?

Signed Perlin noise and sin() return values in -1..1. fit11 maps that range into your target range directly, so you do not have to rescale by hand.

Open Houdini VEX Lab