Skip to content

Instantly share code, notes, and snippets.

@companje
Created January 23, 2018 22:46
Show Gist options
  • Save companje/29408948f1e8be54dd5733a74ca49bb9 to your computer and use it in GitHub Desktop.
Save companje/29408948f1e8be54dd5733a74ca49bb9 to your computer and use it in GitHub Desktop.
map() function for GLSL known from Processing & openFrameworks
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
@mifth
Copy link

mifth commented Jan 23, 2020

Super! Thank you.

@andras-gyarmati
Copy link

thank you!

@inca
Copy link

inca commented May 9, 2020

Awesome 👍

@Arkanic
Copy link

Arkanic commented Dec 19, 2020

thanks

@hamid814
Copy link

Greate!

@fqhd
Copy link

fqhd commented Jun 12, 2021

Thanks!

@tomcatmew
Copy link

LIFE SAVIOR

@bhoffmann93
Copy link

thanks

@FragrantGingerCalamari
Copy link

thanks!

@Ivan-Malin
Copy link

Thanks!

@POPOBE97
Copy link

Thanks!

@rinzexe
Copy link

rinzexe commented Apr 17, 2024

goat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment