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

glsl-transpose

Transpose a matrix in GLSL.

Example

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

void main() {
  mat3 m = mat3(1, 2, 3,
                4, 5, 6,
                7, 8, 9);

  mat3 mt = transpose(m);

  //now mt is the transpose of m
}

Usage

Install with npm:

npm install glsl-transpose

Then use with glslify.

API

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

mt = transpose(float|mat2|mat3|mat4 m)

Computes the transpose of a matrix

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

Returns The transpose 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 - 2017 © taobao.org |