Skip to content

Instantly share code, notes, and snippets.

@romainavalle
Last active June 13, 2023 18:18
Show Gist options
  • Save romainavalle/5623368fd5bdebebfa17f833af648283 to your computer and use it in GitHub Desktop.
Save romainavalle/5623368fd5bdebebfa17f833af648283 to your computer and use it in GitHub Desktop.
// https://gist.github.com/raphaelameaume
vec2 uvRotate (vec2 baseUv, float angle, vec2 center) {
vec2 uv = baseUv;
uv -= center;
mat2 m = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
uv = m * uv;
uv += center;
return uv;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment