How to use the gl-mat4.invert 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 jscad / OpenJSCAD.org / packages / utils / regl-renderer / src / rendering / commands / drawMesh / index.js View on Github external
unormal: (context, props) => {
        const model = props.model || props.transforms.matrix
        // console.log('here', model)
        // const model = mat4.identity([])
        const modelViewMatrix = mat4.multiply(mat4.create(), model, props.camera.view)
        const normalMatrix = mat4.create()
        mat4.invert(normalMatrix, modelViewMatrix)
        mat4.transpose(normalMatrix, normalMatrix)
        return normalMatrix
      }
    },
github tmpvar / ray-aabb / example / cube.js View on Github external
function getEye(out, view) {
  mat4.invert(m4scratch, view);
  out[0] = m4scratch[12];
  out[1] = m4scratch[13];
  out[2] = m4scratch[14]
  return out;
}
github jscad / csg-viewer / src / rendering / drawMesh / index.js View on Github external
unormal: (context, props) => {
        const model = props.model
        const modelViewMatrix = mat4.multiply(mat4.create(), model, props.camera.view)
        const normalMatrix = mat4.create()
        mat4.invert(normalMatrix, modelViewMatrix)
        mat4.transpose(normalMatrix, normalMatrix)
        return normalMatrix
      }
    },

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