Skip to content

Instantly share code, notes, and snippets.

@Pyromuffin
Created July 10, 2018 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pyromuffin/499beead13f34c303a83063c838aee09 to your computer and use it in GitHub Desktop.
Save Pyromuffin/499beead13f34c303a83063c838aee09 to your computer and use it in GitHub Desktop.
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