Created
January 24, 2019 14:44
-
-
Save Mamboleoo/21fe83eab3f12707bcf8a0cc571b8bf8 to your computer and use it in GitHub Desktop.
Render [2D-3D]
This file contains hidden or 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
function render() { | |
// Clear the scene from top left to bottom right | |
ctx.clearRect(0, 0, width, height); | |
// Loop through the dots array and draw every dot | |
for (var i = 0; i < dots.length; i++) { | |
dots[i].draw(); | |
} | |
// Request the browser the call render once its ready for a new frame | |
window.requestAnimationFrame(render); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment