Last active
March 30, 2020 06:08
-
-
Save RenaudRohlinger/a726608a81d1574afde521d2f5c782d0 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 loopFunction() { | |
var distance = Math.round(camera.position.x / sectionWidth) | |
if (distance !== this.loopSectionPosition) { | |
loopSectionPosition = distance | |
setInstancedMeshPositions(mesh, loopSectionPosition) | |
} | |
} | |
function render() { | |
// move the camera | |
camera.position.x += 5. | |
loopFunction() | |
renderer.render( scene, camera ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment