I've noticed that most examples use a loop structure to render the scene, like so:
renderer.render(scene, camera);
function render(){
renderer.render(scene, camera);
//code for rendering
requestAnimationFrame(render);
}
render();
However, I am interested in controlling the rendering in a different structure, only when I interact with something, such as:
while(true){
//code - operations
alert('press ok for the next step'); // or wait 2 seconds
renderer.render(scene, camera);
}
What would be the appropriate method for achieving this?