All setInterval

This commit is contained in:
Thomas FORGIONE
2015-06-30 14:21:51 +02:00
parent 64b27b3e1f
commit 5259a8feea
3 changed files with 9 additions and 3 deletions

View File

@@ -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();

View File

@@ -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();

View File

@@ -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);