Skip to content

Instantly share code, notes, and snippets.

@Mamboleoo
Created January 24, 2019 14:44
Show Gist options
  • Save Mamboleoo/21fe83eab3f12707bcf8a0cc571b8bf8 to your computer and use it in GitHub Desktop.
Save Mamboleoo/21fe83eab3f12707bcf8a0cc571b8bf8 to your computer and use it in GitHub Desktop.
Render [2D-3D]
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