Skip to content

Instantly share code, notes, and snippets.

@EricTRocks
Created April 26, 2016 22:50
Show Gist options
  • Save EricTRocks/c139c94f6fc0d7fbe91df0287953a3b8 to your computer and use it in GitHub Desktop.
Save EricTRocks/c139c94f6fc0d7fbe91df0287953a3b8 to your computer and use it in GitHub Desktop.
Interpolate between 2 values with bias
// 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