1.0.1 • Published 10 years ago
mat4-css-stringify v1.0.1
mat4-css-stringify
Stringifies a 4x4 matrix (stored in a 16 float flat array) into a matrix3d()
string. Useful in conjunction with mat4-css-parse.
var stringify = require('mat4-css-stringify')
var parse = require('mat4-css-parse')
//get element's current transformation
var mat4 = parse(computedStyle.transform)
// ... do some matrix operations on the array
//then update the transform
var style = stringify(mat4)
require('dom-css')(element, 'transform', style)
Usage
str = stringify(matrix)
Returns a matrix3d()
string representing the given 4x4 matrix (i.e. array with 16 floats).
License
MIT, see LICENSE.md for details.