css-transform-to-mat4

    1.0.4 • Public • Published

    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.

    Install

    npm i css-transform-to-mat4

    DownloadsWeekly Downloads

    2

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • mikkoh