Skip to content

Instantly share code, notes, and snippets.

@AlainBarrios
Last active April 17, 2019 15:36
Show Gist options
  • Save AlainBarrios/f7b169e00fa6c48c478e9ad4d2cdd970 to your computer and use it in GitHub Desktop.
Save AlainBarrios/f7b169e00fa6c48c478e9ad4d2cdd970 to your computer and use it in GitHub Desktop.
rotation for uv space in 2d
vec2 rotate(vec2 v, float a) {
float s = sin(a);
float c = cos(a);
mat2 m = mat2(c, -s, s, c);
return m * v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment