Created
September 23, 2016 13:50
-
-
Save PopupAsylum/35cf8da25de007b271be00a3b0a8d643 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
float3 GetAxis(float3 input) { | |
input = normalize(input) ; | |
float3 signs = sign(input) ; | |
float3 abss = abs(input) ; | |
float maxs = max(abss.x, max(abss.y, abbs.z)); | |
return floor(abss/maxs) * signs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment