How to use the gl-mat4.identity function in gl-mat4

To help you get started, we’ve selected a few gl-mat4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WhitestormJS / nextgl / src / core / Object3D.js View on Github external
constructor() {
    super();

    // FIXME: replace identity() with create()
    this.matrix = identity([]);
    this.matrixWorld = identity([]);
    this.position = [0, 0, 0];
    this.scale = [1, 1, 1];
    this.quaternion = [0, 0, 0, 1];
    this.children = [];
    this.matrixAutoUpdate = true;
    this.matrixWorldAutoUpdate = true;
  }
github jscad / csg-viewer / src / rendering / drawAxis.js View on Github external
return (props) => {
    const defaults = {
      model: mat4.identity([])
    }
    props = Object.assign({}, defaults, props)
    return single([
      { color: xColor, model: mat4.multiply(mat4.create(), props.model, xAxisModel) }, // X
      { color: yColor, model: mat4.multiply(mat4.create(), props.model, yAxisModel) }, // Y
      { color: zColor, model: mat4.multiply(mat4.create(), props.model, zAxisModel) } // Z
    ])
  }
}
github Erkaman / webgl-rsm / main.js View on Github external
model: (_, props, batchId) => {
      var m = mat4.identity([])

      var rot = quat.create()
      quat.rotateX(rot, rot, props.rotation[0])
      quat.rotateY(rot, rot, props.rotation[1])
      quat.rotateZ(rot, rot, props.rotation[2])

      fromRotationTranslationScale2(m, rot, props.translate, [props.scale, props.scale, props.scale])

      return m
    }
  },

gl-mat4

gl-matrix's mat4, split into smaller pieces

Zlib
Latest version published 7 years ago

Package Health Score

56 / 100
Full package analysis