You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mat4-decompose

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mat4-decompose

decomposes a 3D matrix

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
28K
-0.49%
Maintainers
1
Weekly downloads
 
Created
Source

mat4-decompose

stable

Decomposes a 3D matrix, useful for animations. Code ported from W3 CSS Spec. PRs for more tests/robustness/optimizations welcome.

Order:

  • first isolates perspective
  • then determines translation
  • then determines X scale, XY shear, Y scale, XZ and YZ shear, and Z scale
  • then determines quaternion rotation

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

Usage

NPM

valid = decompose(matrix[, translation, scale, skew, perspective, quaternion])

Decomposes the given matrix (an array of 16 floats, like those gl-matrix operates on), storing the results into the specified optional vectors.

  • 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 false is this matrix cannot be decomposed, true otherwise.

License

MIT, see LICENSE.md for details.

Keywords

4x4

FAQs

Package last updated on 08 Feb 2015

Did you know?

Socket

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