Created
October 30, 2017 05:19
-
-
Save keijiro/454c349df6e7effc44eb6dec6813dd60 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
float3x3 Euler3x3(float3 v) | |
{ | |
float sx, cx; | |
float sy, cy; | |
float sz, cz; | |
sincos(v.x, sx, cx); | |
sincos(v.y, sy, cy); | |
sincos(v.z, sz, cz); | |
float3 row1 = float3(sx*sy*sz + cy*cz, sx*sy*cz - cy*sz, cx*sy); | |
float3 row3 = float3(sx*cy*sz - sy*cz, sx*cy*cz + sy*sz, cx*cy); | |
float3 row2 = float3(cx*sz, cx*cz, -sx); | |
return float3x3(row1, row2, row3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment