Skip to content

Instantly share code, notes, and snippets.

@morganwilde
Created May 14, 2013 08:12
Show Gist options
  • Save morganwilde/5574439 to your computer and use it in GitHub Desktop.
Save morganwilde/5574439 to your computer and use it in GitHub Desktop.
CATransform3D matrix with values explained
CATransform3D transformation = CATransform3DIdentity;
// x line
transformation.m11 = 1; // 20% less wide wall
transformation.m12 = 0; //-1 / 10.0; // skews left up, right down if >0
transformation.m13 = 0; // extends sideways for a short time
transformation.m14 = 0;// // 1 / 5000 = left side towards viewer, right side away from viewer
// y line
transformation.m21 = 0; //-1 / 2.0; // skews bottom left, top right if <0
transformation.m22 = 1; // .8 - 20% less tall
transformation.m23 = 0; // extends upward for a short time
transformation.m24 = 0;//1 / 500.0; // 1 / 500.0 = top towards the viewer
// z line
transformation.m31 = 0;
transformation.m32 = 0;
transformation.m33 = 1; // 1 makes no change
transformation.m34 = 0;
// repositioning all axis
transformation.m41 = 0; //-40; // >0 pushes on x-axis right
transformation.m42 = 0; //-20; // >0 pushes on y-axis down
transformation.m43 = 0; // pushes on z-axis
transformation.m44 = 1; // 0.8 - makes the layer disappear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment