From 52ca40b96baa6bd0f4bce48a69b9bb34582386f3 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 27 Aug 2023 15:14:52 +0300 Subject: [WGL/P] Added movement pausing --- Year 2/Computer Graphics with WebGL/Project/Project.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Year 2/Computer Graphics with WebGL/Project/Project.html') 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); -- cgit v1.3.1-23-gd82d