diff options
[WGL/P] Time now actually is in tents of a second
2 files changed, 4 insertions, 4 deletions
| -rw-r--r-- | Year 2/Computer Graphics with WebGL/Project/Project.html | 4 | ||||
| -rw-r--r-- | Year 2/Computer Graphics with WebGL/Project/level.js | 4 |
diff --git a/Year 2/Computer Graphics with WebGL/Project/Project.html b/Year 2/Computer Graphics with WebGL/Project/Project.html index 7b41cbe..7b62624 100644 --- a/Year 2/Computer Graphics with WebGL/Project/Project.html +++ b/Year 2/Computer Graphics with WebGL/Project/Project.html @@ -136,8 +136,8 @@ h2 { function drawFrame()
{
if (startT == -1) { startT = Date.now(); t = 0; }
- var candidat = Math.floor(Date.now() - startT) / 10; // tenths of a second
- if (pauseAnimations) startT += (candidat - t)*10;
+ var candidat = Math.floor(Date.now() - startT) / 100; // tenths of a second
+ if (pauseAnimations) startT += (candidat - t)*100;
else t = candidat;
gl.clear(gl.COLOR_BUFFER_BIT+gl.DEPTH_BUFFER_BIT);
diff --git a/Year 2/Computer Graphics with WebGL/Project/level.js b/Year 2/Computer Graphics with WebGL/Project/level.js index 6d193a3..24944ad 100644 --- a/Year 2/Computer Graphics with WebGL/Project/level.js +++ b/Year 2/Computer Graphics with WebGL/Project/level.js @@ -52,13 +52,13 @@ function createLevels() { "Star passing behind black hole", "You can see how the black hole (correctly) warps the light of the star behind it when it passes", [1000,0,650]); - l1.addStar([1100,0,1000], 10, (t, star) => vecSum(star.center, [-100 * (1 + Math.sin(t/300 + 1.5 * Math.PI)),0,0])); + l1.addStar([1100,0,1000], 10, (t, star) => vecSum(star.center, [-100 * (1 + Math.sin(t/30 + 1.5 * Math.PI)),0,0])); l1.addBlackHole([1000,0,900], 30, undefined); var l2 = new Level( "Star gets closer to event horizon", "As the star passes by behind the black hole, we can see it approaching the event horizon, however, it will never truly reach it and dissapear (at least until it's width becomes smaller than a pixel).", [1014,0,892]); - l2.addStar([1070,0,1000], 10, (t, star) => vecSum(star.center, [-t/8,0,0])); + l2.addStar([1070,0,1000], 10, (t, star) => vecSum(star.center, [-t,0,0])); l2.addBlackHole([1000,0,900], 30, undefined); } |
