How to use the gl-mat4.translate 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 gregtatum / sessions / 006 / circles.js View on Github external
model: ({model}, {scale = 1, translate = 0}) => (
        mat4.scale([], mat4.translate([], model, [0, translate, 0]), [scale, scale, scale])
      )
    },
github regl-project / regl / example / stats.js View on Github external
function createModel (position, scale) {
  var m = mat4.identity([])

  mat4.translate(m, m, position)

  var s = scale
  mat4.scale(m, m, [s, s, s])
  return m
}
github Erkaman / webgl-rsm / main.js View on Github external
function fromRotationTranslationScale2 (out, q, v, s) {
  mat4.identity(out)

  var quatMat = mat4.create()
  mat4.fromQuat(quatMat, q)

  mat4.translate(out, out, v)
  mat4.multiply(out, out, quatMat)
  mat4.scale(out, out, s)

  return out
}
github abiro / screen-space-reflections / demo / index.js View on Github external
bunnyPositions.forEach(function iteratee (pos, i) {
      mat4.translate(modelMatrix, bunnyModelMatrix, pos)

      mat4.rotateY(modelMatrix, modelMatrix, bunnyRotations[i])

      bunnyShader.uniforms.uModel = modelMatrix

      bunnyGeo.draw()
    })

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