Last active
March 30, 2020 06:35
-
-
Save RenaudRohlinger/0fe7e9516f0675a84aa8b0a07e68b0c6 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
function render() { | |
renderer.render( scene, camera ); | |
} | |
function animate() { | |
// render the 3D scene | |
render(); | |
requestAnimationFrame( animate ); | |
} | |
// Call the three scene initialisation, attach the resize event and start the animation requestAnimationFrame. | |
function init () { | |
initThree() | |
resize() | |
window.addEventListener('resize', resize, { passive: true | |
}) | |
addInstancedMesh() | |
animate() | |
} | |
init() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment