Socket
Socket
Sign inDemoInstall

mat4-recompose

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mat4-recompose

recomposes a 4x4 matrix


Version published
Weekly downloads
82K
increased by14.28%
Maintainers
1
Install size
45.4 kB
Created
Weekly downloads
 

Readme

Source

mat4-recompose

stable

Recompose a 4x4 matrix from translation, scale, skew, perspective, and rotation. This is commonly used in matrix animations (i.e. after decompose and interpolation). Code ported from W3 CSS Spec. PRs for more tests/robustness/optimizations welcome.

You may also be interested in mat4-interpolate, mat4-decompose, and css-mat4.

Usage

NPM

recompose(matrix, translation, scale, skew, perspective, quaternion)

Recomposes a matrix with the given vectors, storing the result into matrix (a 16 float array).

  • translation [x, y, z]
  • scale [x, y, z]
  • skew [xy, xz, yz] skew factors
  • perspective [x, y, z, w]
  • quaternion [x, y, z, w]

Returns the matrix being recomposed.

Builds a translation matrix, then applies the quaternion rotation and perspective. The matrix is then multiplied by YZ shear, then XZ shear, then XY shear (if they are non-zero). Finally multiplied by scale to get the resulting recomposed matrix.

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Last updated on 08 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc