{"id":20778097,"url":"https://github.com/stackgl/gl-mat4","last_synced_at":"2025-04-05T04:14:31.502Z","repository":{"id":19819498,"uuid":"23080286","full_name":"stackgl/gl-mat4","owner":"stackgl","description":"gl-matrix's mat4, split into smaller pieces","archived":false,"fork":false,"pushed_at":"2022-10-14T21:05:51.000Z","size":39,"stargazers_count":80,"open_issues_count":4,"forks_count":14,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T03:11:14.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"lengstrom/fast-style-transfer","license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-18T17:36:59.000Z","updated_at":"2024-12-20T20:30:37.000Z","dependencies_parsed_at":"2023-01-11T20:36:56.123Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-mat4","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-mat4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-mat4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-mat4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-mat4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-mat4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284953,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T13:19:09.388Z","updated_at":"2025-04-05T04:14:31.474Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-mat4 [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nPart of a fork of [@toji](http://github.com/toji)'s\n[gl-matrix](http://github.com/toji/gl-matrix) split into smaller pieces: this\npackage contains `glMatrix.mat4`.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-mat4.png)](https://nodei.co/npm/gl-mat4/)\n\n### `mat4 = require('gl-mat4')`\n\nWill load all of the module's functionality and expose it on a single\nobject. Note that any of the methods may also be required directly\nfrom their files.\n\nFor example, the following are equivalent:\n\n``` javascript\nvar scale = require('gl-mat4').scale\nvar scale = require('gl-mat4/scale')\n```\n\n## API\n\n  - [add()](#addoutmat4-amat4-bmat4)\n  - [adjoint()](#adjointoutmat4-amat4)\n  - [clone()](#cloneamat4)\n  - [copy()](#copyoutmat4-amat4)\n  - [create()](#create)\n  - [determinant()](#determinantamat4)\n  - [fromQuat()](#fromquatoutmat4-qquat4)\n  - [fromRotation()](#fromrotationoutmat4-radnumber-axisvec3)\n  - [fromRotationTranslation()](#fromrotationtranslationoutmat4-qquat4-vvec3)\n  - [fromScaling()](#fromscalingoutmat4-vvec3)\n  - [fromTranslation()](#fromtranslationoutmat4-vvec3)\n  - [fromXRotation()](#fromxrotationoutmat4-radnumber)\n  - [fromYRotation()](#fromyrotationoutmat4-radnumber)\n  - [fromZRotation()](#fromzrotationoutmat4-radnumber)\n  - [frustum()](#frustumoutmat4-leftnumber-rightnumber-bottomnumber-topnumber-nearnumber-farnumber)\n  - [identity()](#identityoutmat4)\n  - [invert()](#invertoutmat4-amat4)\n  - [lookAt()](#lookatoutmat4-eyevec3-centervec3-upvec3)\n  - [multiply()](#multiplyoutmat4-amat4-bmat4)\n  - [ortho()](#orthooutmat4-leftnumber-rightnumber-bottomnumber-topnumber-nearnumber-farnumber)\n  - [perspective()](#perspectiveoutmat4-fovynumber-aspectnumber-nearnumber-farnumber)\n  - [perspectiveFromFieldOfView()](#perspectivefromfieldofviewoutmat4-fovobject-nearnumber-farnumber)\n  - [rotate()](#rotateoutmat4-amat4-radnumber-axisvec3)\n  - [rotateX()](#rotatexoutmat4-amat4-radnumber)\n  - [rotateY()](#rotateyoutmat4-amat4-radnumber)\n  - [rotateZ()](#rotatezoutmat4-amat4-radnumber)\n  - [scale()](#scaleoutmat4-amat4-vvec3)\n  - [str()](#strmatmat4)\n  - [sub()](#suboutmat4-amat4-bmat4)\n  - [translate()](#translateoutmat4-amat4-vvec3)\n  - [transpose()](#transposeoutmat4-amat4)\n\n## add(out:mat4, a:mat4, b:mat4)\n\n  Adds two mat4's\n\n## adjoint(out:mat4, a:mat4)\n\n  Calculates the adjugate of a mat4\n\n## clone(a:mat4)\n\n  Creates a new mat4 initialized with values from an existing matrix\n\n## copy(out:mat4, a:mat4)\n\n  Copy the values from one mat4 to another\n\n## create()\n\n  Creates a new identity mat4\n\n## determinant(a:mat4)\n\n  Calculates the determinant of a mat4\n\n## fromQuat(out:mat4, q:quat4)\n\n  Creates a matrix from a quaternion rotation.\n\n## fromRotation(out:mat4, rad:number, axis:vec3)\n\n  Creates a matrix from a given angle around a given axis\n  This is equivalent to (but much faster than):\n\n```js\n  mat4.identity(dest);\n  mat4.rotate(dest, dest, rad, axis);\n```\n\n## fromRotationTranslation(out:mat4, q:quat4, v:vec3)\n\n  Creates a matrix from a quaternion rotation and vector translation. This is equivalent to (but much faster than):\n  \n```js\n  mat4.identity(dest);\n  mat4.translate(dest, vec);\n  var quatMat = mat4.create();\n  quat4.toMat4(quat, quatMat);\n  mat4.multiply(dest, quatMat);\n```\n\n## fromScaling(out:mat4, v:vec3)\n  Creates a matrix from a vector scaling. This is equivalent to (but much faster than):\n \n```js\n  mat4.identity(dest);\n  mat4.translate(dest, dest, vec);\n```\n\n## fromTranslation(out:mat4, v:vec3)\n  Creates a matrix from a vector translation. This is equivalent to (but much faster than):\n \n```js\n  mat4.identity(dest);\n  mat4.translate(dest, dest, vec);\n```\n\n## fromTranslation(out:mat4, v:vec3)\n  Creates a matrix from a vector translation\n  This is equivalent to (but much faster than):\n \n```js\n  mat4.identity(dest);\n  mat4.translate(dest, dest, vec);\n```\n\n## fromXRotation(out:mat4, rad:Number)\n\n  Creates a matrix from the given angle around the X axis\n  This is equivalent to (but much faster than):\n  \n```js\n  mat4.identity(dest)\n  mat4.rotateX(dest, dest, rad)\n```\n\n## fromYRotation(out:mat4, rad:Number)\n\n  Creates a matrix from the given angle around the Y axis\n  This is equivalent to (but much faster than):\n  \n```js\n  mat4.identity(dest)\n  mat4.rotateY(dest, dest, rad)\n```\n\n## fromZRotation(out:mat4, rad:Number)\n\n  Creates a matrix from the given angle around the Z axis\n  This is equivalent to (but much faster than):\n  \n```js\n  mat4.identity(dest)\n  mat4.rotateZ(dest, dest, rad)\n```\n\n## frustum(out:mat4, left:Number, right:Number, bottom:Number, top:Number, near:Number, far:Number)\n\n  Generates a frustum matrix with the given bounds\n\n## identity(out:mat4)\n\n  Set a mat4 to the identity matrix\n\n## invert(out:mat4, a:mat4)\n\n  Inverts a mat4\n\n## lookAt(out:mat4, eye:vec3, center:vec3, up:vec3)\n\n  Generates a look-at matrix with the given eye position, focal point, and up axis\n\n## multiply(out:mat4, a:mat4, b:mat4)\n\n  Multiplies two mat4's\n\n## ortho(out:mat4, left:number, right:number, bottom:number, top:number, near:number, far:number)\n\n  Generates a orthogonal projection matrix with the given bounds\n\n## perspective(out:mat4, fovy:number, aspect:number, near:number, far:number)\n\n  Generates a perspective projection matrix with the given bounds\n\n## perspectiveFromFieldOfView(out:mat4, fov:object, near:number, far:number)\n\n  Generates a perspective projection matrix with the given field of view.\n\n## rotate(out:mat4, a:mat4, rad:Number, axis:vec3)\n\n  Rotates a mat4 by the given angle\n\n## rotateX(out:mat4, a:mat4, rad:Number)\n\n  Rotates a matrix by the given angle around the X axis\n\n## rotateY(out:mat4, a:mat4, rad:Number)\n\n  Rotates a matrix by the given angle around the Y axis\n\n## rotateZ(out:mat4, a:mat4, rad:Number)\n\n  Rotates a matrix by the given angle around the Z axis\n\n## scale(out:mat4, a:mat4, v:vec3)\n\n  Scales the mat4 by the dimensions in the given vec3\n\n## str(mat:mat4)\n\n  Returns a string representation of a mat4\n\n## sub(out:mat4, a:mat4, b:mat4)\n\n  Subtracts two mat4's\n\n## translate(out:mat4, a:mat4, v:vec3)\n\n  Translate a mat4 by the given vector\n\n## transpose(out:mat4, a:mat4)\n\n  Transpose the values of a mat4\n\n## License\n\n[zlib](http://en.wikipedia.org/wiki/Zlib_License). See [LICENSE.md](https://github.com/stackgl/gl-mat4/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-mat4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-mat4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-mat4/lists"}