Parcourir la source

Docs: clarify requestAnimationFrame speed

It's not strictly true that requestAnimationFrame runs at 60fps - it depends on the device.
Assuming 60fps will make your app misbehave on computers with 75hz or 144hz screens.
This is an early tutorial, but let's at least give an early heads up that there's a gotcha here.
Tomasz Wesołowski il y a 7 ans
Parent
commit
6eccc28de3
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      docs/manual/introduction/Creating-a-scene.html

+ 2 - 2
docs/manual/introduction/Creating-a-scene.html

@@ -100,7 +100,7 @@
 		animate();
 		</code>
 
-		<div>This will create a loop that causes the renderer to draw the scene 60 times per second. If you're new to writing games in the browser, you might say <em>"why don't we just create a setInterval ?"</em> The thing is - we could, but <strong>requestAnimationFrame</strong> has a number of advantages. Perhaps the most important one is that it pauses when the user navigates to another browser tab, hence not wasting their precious processing power and battery life.</div>
+		<div>This will create a loop that causes the renderer to draw the scene every time the screen is refreshed (on a typical screen this means 60 times per second). If you're new to writing games in the browser, you might say <em>"why don't we just create a setInterval ?"</em> The thing is - we could, but <strong>requestAnimationFrame</strong> has a number of advantages. Perhaps the most important one is that it pauses when the user navigates to another browser tab, hence not wasting their precious processing power and battery life.</div>
 
 		<h2>Animating the cube</h2>
 
@@ -113,7 +113,7 @@
 		cube.rotation.y += 0.1;
 		</code>
 
-		<div>This will be run every frame (60 times per second), and give the cube a nice rotation animation. Basically, anything you want to move or change while the app is running has to go through the animate loop. You can of course call other functions from there, so that you don't end up with a <strong>animate</strong> function that's hundreds of lines.
+		<div>This will be run every frame (normally 60 times per second), and give the cube a nice rotation animation. Basically, anything you want to move or change while the app is running has to go through the animate loop. You can of course call other functions from there, so that you don't end up with a <strong>animate</strong> function that's hundreds of lines.
 		</div>
 
 		<h2>The result</h2>