mat4-recompose

WebJar for mat4-recompose

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

mat4-recompose
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

mat4-recompose
WebJar for mat4-recompose
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mattdesl/mat4-recompose

Download mat4-recompose

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mat4-recompose/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mat4-recompose</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mat4-recompose/
implementation 'org.webjars.npm:mat4-recompose:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/mat4-recompose/
implementation ("org.webjars.npm:mat4-recompose:1.0.4")
'org.webjars.npm:mat4-recompose:jar:1.0.4'
<dependency org="org.webjars.npm" name="mat4-recompose" rev="1.0.4">
  <artifact name="mat4-recompose" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mat4-recompose', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "mat4-recompose" % "1.0.4"
[org.webjars.npm/mat4-recompose "1.0.4"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : gl-mat4 jar [1.0.1,2)

Project Modules

There are no modules declared in this project.

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.

Versions

Version
1.0.4