Created
April 26, 2016 22:50
-
-
Save EricTRocks/c139c94f6fc0d7fbe91df0287953a3b8 to your computer and use it in GitHub Desktop.
Interpolate between 2 values with bias
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
// Calculate the twist blend with bias | |
Scalar bias = 0.5; | |
Integer divisions = 5; | |
Scalar fraction = Scalar(i) / Scalar(divisions - 1); | |
Scalar biasBlend = fraction / ((((1.0 / bias) - 2.0) * (1.0 - fraction)) + 1.0); | |
Scalar blend = Math_linearInterpolate(0.0, 1.0, biasBlend); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment