Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}
},
function getEye(out, view) {
mat4.invert(m4scratch, view);
out[0] = m4scratch[12];
out[1] = m4scratch[13];
out[2] = m4scratch[14]
return out;
}
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
}
},