From 5259a8feea7f83c51f0f06f0975a5c072202e151 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Tue, 30 Jun 2015 14:21:51 +0200 Subject: [PATCH] All setInterval --- js/prototype/replay.js | 4 +++- js/prototype/tutorial.js | 4 +++- js/stream/main.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/js/prototype/replay.js b/js/prototype/replay.js index 6d7f6b3..cc5299c 100644 --- a/js/prototype/replay.js +++ b/js/prototype/replay.js @@ -77,6 +77,8 @@ function init() { // Add listeners initListeners(); + + setInterval(animate, 20); } function initListeners() { @@ -203,7 +205,7 @@ function render() { function animate() { // Render each frame - requestAnimationFrame(animate); + // requestAnimationFrame(animate); // stats count the number of frames per second stats.begin(); diff --git a/js/prototype/tutorial.js b/js/prototype/tutorial.js index d53cbe7..756f81c 100644 --- a/js/prototype/tutorial.js +++ b/js/prototype/tutorial.js @@ -97,6 +97,8 @@ function init() { initListeners(); tutorial.nextStep(); + + setInterval(animate, 20); } function initListeners() { @@ -174,7 +176,7 @@ function render() { function animate() { // Render each frame - requestAnimationFrame(animate); + // requestAnimationFrame(animate); // stats count the number of frames per second stats.begin(); diff --git a/js/stream/main.js b/js/stream/main.js index 8c8d8c5..77e2b19 100644 --- a/js/stream/main.js +++ b/js/stream/main.js @@ -53,10 +53,12 @@ function init() { plane.translate(0,0,-100); plane.addToScene(scene); + + setInterval(animate, 20); } function animate() { - requestAnimationFrame(animate); + // requestAnimationFrame(animate); var currentTime = Date.now() - previousTime; camera.update(isNaN(currentTime) ? 20 : currentTime);