Created
July 10, 2018 07:12
-
-
Save Pyromuffin/499beead13f34c303a83063c838aee09 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
Matrix4x4 mat; | |
mat = Matrix4x4.Translate(new Vector3(centerPoint.x, centerPoint.y)); | |
mat *= Matrix4x4.Rotate(Quaternion.AngleAxis(degrees, Vector3.forward)); | |
mat *= Matrix4x4.Translate(new Vector3(-centerPoint.x, -centerPoint.y)); | |
Basis basis; | |
basis.right = new Vector2(mat.m00, mat.m01 ); | |
basis.up = new Vector2(mat.m10 , mat.m11); | |
basis.offset = new Vector2(mat.m03, mat.m13); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment