Generate a 3D lookAt matrix in GLSL
npm install glsl-look-at
Generates a 3D lookAt matrix in GLSL.

Creates a mat3 matrix you can use to transform coordinates
to look towards a given point, where:
* origin is the position of the camera.
* target is the position to look towards.
* roll is the roll rotation of the camera.
`` glsl
#pragma glslify: lookAt = require('glsl-look-at')
uniform vec2 iResolution;
void main() {
// Required bootstrap for a Shadertoy-style
// raytracing scene:
vec2 p = (2.0*gl_FragCoord.xy-iResolution.xy)/iResolution.y;
vec2 ro = vec3(3.5sin(0.0),3.0,3.5cos(0.0));
vec2 ta = vec3(0.0,0.0,0.0);
// ...
mat3 camMat = lookAt(ro, ta, 0.0);
vec3 rd = normalize(camMat * vec3(p, 2.0));
// ...
}
``
See stackgl/contributing for details.
MIT. See LICENSE.md for details.