Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / Project.html
diff options
context:
space:
mode:
Commit52ca40b96baa6bd0f4bce48a69b9bb34582386f3 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-27 15:14:52 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-27 15:14:52 +0300
Filese104b2909afceafbc4beb77044e5f303abf1e1ef /Year 2/Computer Graphics with WebGL/Project/Project.html
uni-projects-52ca40b96baa6bd0f4bce48a69b9bb34582386f3.tar
uni-projects-52ca40b96baa6bd0f4bce48a69b9bb34582386f3.tar.gz
uni-projects-52ca40b96baa6bd0f4bce48a69b9bb34582386f3.zip
Parent8608f2c0e0d02e58df9280eab03a6b7a96acd5f1 (diff)
[WGL/P] Added movement pausing
1 files changed, 2 insertions, 2 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/Project.html4
diff --git a/Year 2/Computer Graphics with WebGL/Project/Project.html b/Year 2/Computer Graphics with WebGL/Project/Project.html
index 1dc3ffe..202b01c 100644
--- a/Year 2/Computer Graphics with WebGL/Project/Project.html
+++ b/Year 2/Computer Graphics with WebGL/Project/Project.html
@@ -123,6 +123,7 @@ h2 {
}
window.onresize = resizeglcanvas;
+ var pauseAnimations = false;
function drawFrame()
{
gl.clear(gl.COLOR_BUFFER_BIT+gl.DEPTH_BUFFER_BIT);
@@ -130,9 +131,8 @@ h2 {
updateCamera();
gl.uniform3fv(uEye, pos);
- // stars[0].moveTo(vecSum(stars[0].sphere.center, [-0.5,0,0]));
-
skybox.draw();
+ if (!pauseAnimations) animations.forEach((a) => a());
stars.forEach((s) => s.draw());
requestAnimationFrame(drawFrame);