diff options
[WGL/P] Added movement pausing
1 files changed, 2 insertions, 2 deletions
| -rw-r--r-- | Year 2/Computer Graphics with WebGL/Project/Project.html | 4 |
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);
|
