glsl-inverse
Invert a matrix in GLSL
Last updated 6 years ago by mikolalysenko .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install glsl-inverse 
SYNC missed versions from official npm registry.

glsl-inverse

Invert a matrix in GLSL.

Example

#pragma glslify: inverse = require(glsl-inverse)

void main() {
  mat3 m = mat3(1, 2, -3,
                4, 0, 6,
                7.1, 8, 9);

  mat3 mi = inverse(m);

  //now mi is the inverse of m
}

Usage

Install with npm:

npm install glsl-inverse

Then use with glslify.

API

#pragma glslify: inverse = require(glsl-inverse)

mi = inverse(float|mat2|mat3|mat4 m)

Computes inverse of m

  • m is a matrix to invert, either float, mat2, mat3 or mat4

Returns The inverse of m

License

(c) 2014 Mikola Lysenko. MIT License

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

1 Versions

  • 1.0.0                                ...           6 years ago

Copyright 2014 - 2016 © taobao.org |