Created
February 21, 2019 19:25
-
-
Save graphoarty/8e4b268f490c522ea1a1f9efad1dfc81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Call the animate function | |
animate(); | |
// The animated function updates the scene | |
// and updates the controls | |
function animate() { | |
// The window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests that the browser calls a specified function to update an animation before the next repaint. (docs) | |
requestAnimationFrame(animate); | |
// Update the controls | |
controls.update(); | |
// Render the scene | |
renderer.render(scene, camera); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment