Skip to content

Instantly share code, notes, and snippets.

@skyburchard
Last active January 2, 2021 00:48
Show Gist options
  • Save skyburchard/fbd040716299377c3f2e0d8683c66777 to your computer and use it in GitHub Desktop.
Save skyburchard/fbd040716299377c3f2e0d8683c66777 to your computer and use it in GitHub Desktop.
simple remapping equations
//////////////////////////
// -1 to 1 remap to 0 to 1
//////////////////////////
x = x / 2 + 0.5;
//////////////////////////
// 0 to 1 remap to -1 to 1
//////////////////////////
x = x * 2 -1;
//////////////////////////
// 0 to 1 remap to 1 to 0
//////////////////////////
x = 1 - x;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment