Last active
January 2, 2021 00:48
-
-
Save skyburchard/fbd040716299377c3f2e0d8683c66777 to your computer and use it in GitHub Desktop.
simple remapping equations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////// | |
// -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