Skip to content

Will take a string which is a css transform value (2d or 3d) and return a mat4 or 3d transformation matrix from the string.

License

Notifications You must be signed in to change notification settings

Experience-Monks/css-transform-to-mat4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

css-transform-to-mat4

experimental

Will take a string which is a css transform value (2d or 3d) and return a mat4 or 3d transformation matrix from the string.

Usage

NPM

Example:

var getMatrix = require('css-transform-to-mat4');

var matrix3DA = getMatrix('translate(40px, 20px)'); // works with 2d transforms
var matrix3DB = getMatrix('perspective(1000px) translate3d(40px, 20px, -1000px)'); // and 3d

To see more examples check out: http://requirebin.com/?gist=adf102de923cf6f1dc82

License

MIT, see LICENSE.md for details.

About

Will take a string which is a css transform value (2d or 3d) and return a mat4 or 3d transformation matrix from the string.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published