Last active
June 13, 2023 18:18
-
-
Save romainavalle/5623368fd5bdebebfa17f833af648283 to your computer and use it in GitHub Desktop.
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
// 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