diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2021-12-29 12:11:44 -0500 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2021-12-29 12:11:44 -0500 |
commit | d574b18884401d2a0a1f8d4422c1512de3dcbee6 (patch) | |
tree | f08466db076564aae7bfa685a9a733bfc20c3dd7 /blockgame/camera.js | |
parent | 9acfb6bfffc31e39dfb273f870a2235e5968ffc9 (diff) | |
download | website-d574b18884401d2a0a1f8d4422c1512de3dcbee6.tar.gz website-d574b18884401d2a0a1f8d4422c1512de3dcbee6.tar.bz2 website-d574b18884401d2a0a1f8d4422c1512de3dcbee6.zip |
Change style for better readability.
style.css overhaul, now resembles windows 3.1 UI.
slight change to intro text.
reposition buttons to right edge.
projects box.
diheap project summary and download page.
Diffstat (limited to 'blockgame/camera.js')
-rw-r--r-- | blockgame/camera.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/blockgame/camera.js b/blockgame/camera.js deleted file mode 100644 index f696441..0000000 --- a/blockgame/camera.js +++ /dev/null @@ -1,42 +0,0 @@ -export class Camera { - constructor(gl) { - const fieldOfView = 45 * Math.PI / 180; // in radians - const aspect = gl.canvas.clientWidth / gl.canvas.clientHeight; - const zNear = 0.1; - const zFar = 100.0; - const projectionMatrix = mat4.create(); - - // note: glmatrix.js always has the first argument - // as the destination to receive the result. - mat4.perspective(projectionMatrix, - fieldOfView, - aspect, - zNear, - zFar); - - // Set the drawing position to the "identity" point, which is - // the center of the scene. - const modelViewMatrix = mat4.create(); - - // Now move the drawing position a bit to where we want to - // start drawing the square. - - mat4.translate(modelViewMatrix, // destination matrix - modelViewMatrix, // matrix to translate - [-0.0, 0.0, -6.0]); // amount to translate - - this.mvmatrix = modelViewMatrix; - this.pmatrix = projectionMatrix; - } - - use(gl, shader) { - gl.uniformMatrix4fv( - shader.uniforms.projectionMatrix, - false, - this.pmatrix); - gl.uniformMatrix4fv( - shader.uniforms.modelViewMatrix, - false, - this.mvmatrix); - } -} |