Simstim

VEX Dictionary / fit

fit

Remaps a value from one range into another, clamped to the new range.

group: interpinterp

Available in every context

Usage

float fit(float value, float omin, float omax, float nmin, float nmax)
<vector> fit(<vector> value, <vector> omin, <vector> omax, <vector> nmin, <vector> nmax)

Examples

Height gradient mask sop
f@mask = fit(@P.y, chf("low"), chf("high"), 0, 1);

fit remaps a value from one range into another and clamps it to the new range. Here height becomes a 0–1 mask that you can shape further with a ramp.

Use cases

Signatures (from vcc -X)

Related

Full SideFX documentation ↗