gl-mat4

WebJar for gl-mat4

License

License

ZLIB
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

gl-mat4
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

gl-mat4
WebJar for gl-mat4
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/stackgl/gl-mat4

Download gl-mat4

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

gl-mat4 stable

Part of a fork of @toji's gl-matrix split into smaller pieces: this package contains glMatrix.mat4.

Usage

NPM

mat4 = require('gl-mat4')

Will load all of the module's functionality and expose it on a single object. Note that any of the methods may also be required directly from their files.

For example, the following are equivalent:

var scale = require('gl-mat4').scale
var scale = require('gl-mat4/scale')

API

adjoint(out:mat4, a:mat4)

Calculates the adjugate of a mat4

clone(a:mat4)

Creates a new mat4 initialized with values from an existing matrix

copy(out:mat4, a:mat4)

Copy the values from one mat4 to another

create()

Creates a new identity mat4

determinant(a:mat4)

Calculates the determinant of a mat4

fromQuat(out:mat4, q:quat4)

Creates a matrix from a quaternion rotation.

fromRotation(out:mat4, rad:number, axis:vec3)

Creates a matrix from a given angle around a given axis This is equivalent to (but much faster than):

  mat4.identity(dest);
  mat4.rotate(dest, dest, rad, axis);

fromRotationTranslation(out:mat4, q:quat4, v:vec3)

Creates a matrix from a quaternion rotation and vector translation. This is equivalent to (but much faster than):

  mat4.identity(dest);
  mat4.translate(dest, vec);
  var quatMat = mat4.create();
  quat4.toMat4(quat, quatMat);
  mat4.multiply(dest, quatMat);

fromScaling(out:mat4, v:vec3)

Creates a matrix from a vector scaling. This is equivalent to (but much faster than):

  mat4.identity(dest);
  mat4.translate(dest, dest, vec);

fromTranslation(out:mat4, v:vec3)

Creates a matrix from a vector translation. This is equivalent to (but much faster than):

  mat4.identity(dest);
  mat4.translate(dest, dest, vec);

fromTranslation(out:mat4, v:vec3)

Creates a matrix from a vector translation This is equivalent to (but much faster than):

  mat4.identity(dest);
  mat4.translate(dest, dest, vec);

fromXRotation(out:mat4, rad:Number)

Creates a matrix from the given angle around the X axis This is equivalent to (but much faster than):

  mat4.identity(dest)
  mat4.rotateX(dest, dest, rad)

fromYRotation(out:mat4, rad:Number)

Creates a matrix from the given angle around the Y axis This is equivalent to (but much faster than):

  mat4.identity(dest)
  mat4.rotateY(dest, dest, rad)

fromZRotation(out:mat4, rad:Number)

Creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than):

  mat4.identity(dest)
  mat4.rotateZ(dest, dest, rad)

frustum(out:mat4, left:Number, right:Number, bottom:Number, top:Number, near:Number, far:Number)

Generates a frustum matrix with the given bounds

identity(out:mat4)

Set a mat4 to the identity matrix

invert(out:mat4, a:mat4)

Inverts a mat4

lookAt(out:mat4, eye:vec3, center:vec3, up:vec3)

Generates a look-at matrix with the given eye position, focal point, and up axis

multiply(out:mat4, a:mat4, b:mat4)

Multiplies two mat4's

ortho(out:mat4, left:number, right:number, bottom:number, top:number, near:number, far:number)

Generates a orthogonal projection matrix with the given bounds

perspective(out:mat4, fovy:number, aspect:number, near:number, far:number)

Generates a perspective projection matrix with the given bounds

perspectiveFromFieldOfView(out:mat4, fov:object, near:number, far:number)

Generates a perspective projection matrix with the given field of view.

rotate(out:mat4, a:mat4, rad:Number, axis:vec3)

Rotates a mat4 by the given angle

rotateX(out:mat4, a:mat4, rad:Number)

Rotates a matrix by the given angle around the X axis

rotateY(out:mat4, a:mat4, rad:Number)

Rotates a matrix by the given angle around the Y axis

rotateZ(out:mat4, a:mat4, rad:Number)

Rotates a matrix by the given angle around the Z axis

scale(out:mat4, a:mat4, v:vec3)

Scales the mat4 by the dimensions in the given vec3

str(mat:mat4)

Returns a string representation of a mat4

translate(out:mat4, a:mat4, v:vec3)

Translate a mat4 by the given vector

transpose(out:mat4, a:mat4)

Transpose the values of a mat4

License

zlib. See LICENSE.md for details.

org.webjars.npm

stackgl

Modular WebGL components

Versions

Version
1.2.0
1.1.4