Javascript: matrix operations for CSS transform perspective
I'm using this script that claims to implement matrix3d operation as described in the spec , however the script is missing matrix perspective operations, so I "cooked" something I'm not sure is either accurate or correct. // the perspective matrix to multiply with CSSMatrix.Perspective = function(x, y, z){ var m = new CSSMatrix(); m.m13 = x; m.m23 = y; m.m33 = z; return m; }; and the method to use this matrix // myMatrix.perspective(x,y,z); to apply a perspective matrix CSSMatrix.prototype.perspective = function(x, y, z){ if (y == null) y = 0; if (z == null) z = 0; return CSSMatrix.multiply