Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / Project.html
diff options
context:
space:
mode:
Commit7994fe1a000768b6ad21997039ab5960d4c530af (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-26 14:25:30 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-26 14:25:30 +0300
Filesb55d7bbeeedad70f9a28e1b97c75dc22f022f67d /Year 2/Computer Graphics with WebGL/Project/Project.html
uni-projects-7994fe1a000768b6ad21997039ab5960d4c530af.tar
uni-projects-7994fe1a000768b6ad21997039ab5960d4c530af.tar.gz
uni-projects-7994fe1a000768b6ad21997039ab5960d4c530af.zip
Parentf5fa572ab70664129ae8c2d81665752f0f8f7f88 (diff)
[WGL/P] Fully implemented ray tracing
1 files changed, 0 insertions, 14 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/Project.html14
diff --git a/Year 2/Computer Graphics with WebGL/Project/Project.html b/Year 2/Computer Graphics with WebGL/Project/Project.html
index cf55554..fc9bae8 100644
--- a/Year 2/Computer Graphics with WebGL/Project/Project.html
+++ b/Year 2/Computer Graphics with WebGL/Project/Project.html
@@ -125,17 +125,6 @@ h2 {
gl.canvas.height = gl.canvas.offsetHeight;
gl.viewport(0,0,gl.canvas.width,gl.canvas.height);
- // (Look at Presentation 6, Slide 21, the prespective projection diagram)
- // Since we're gonna be raycasting, we need to know where the near side is and it's
- // dimentions in our coordinate system, so we can offset the rays properly.
- // First, we pass the viewPort to convert our pixel coordinates to percentage of the
- // screen.
- gl.uniform2f(uViewPort, gl.canvas.width, gl.canvas.height);
- w = 2 * Math.tan(PERSPECTIVE_ANGLE / 360 * Math.PI) * PERSPECTIVE_NEAR;
- // The height of the near wall is determined by the aspect ratio.
- gl.uniform2f(uPerspSize, w, gl.canvas.height / gl.canvas.width * w);
- gl.uniform1f(uPerspDist, PERSPECTIVE_NEAR);
-
drawFrame();
}
window.onresize = resizeglcanvas;
@@ -146,9 +135,6 @@ h2 {
lookUpdate();
gl.uniform3fv(uEye, pos);
- gl.uniform3fv(uEyeForward, forward.toCartesian());
- gl.uniform3fv(uEyeUp, up.toCartesian());
- gl.uniform3fv(uEyeLeft, left.toCartesian());
skybox.draw();
star.draw();