Created
January 3, 2021 13:55
-
-
Save supahfunk/047f78d22cb7f05a0621d0b3026ee3de to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| vec3 rotateAxis(vec3 p, vec3 axis, float angle) { | |
| return mix(dot(axis, p)*axis, p, cos(angle)) + cross(axis,p)*sin(angle); | |
| } | |
| // pos = rotateAxis(pos, vec3(1., 0., 0.), PI * .5); // => Rotate X Axis 180deg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment