How do I stop requestAnimationFrame

前端 未结 1 1841
梦如初夏
梦如初夏 2020-12-08 19:59

I need to remove a canvas and build a new one. I\'m having a problem where I don\'t know how to stop/interrupt the Three.js or webGL update process. I can stop it if I force

相关标签:
1条回答
  • 2020-12-08 20:56
    var id;
    
    function animate() {
    
        id = requestAnimationFrame( animate );
    
        renderer.render( scene, camera );
    
    }
    

    To cancel

    cancelAnimationFrame( id );
    

    three.js r.55

    0 讨论(0)
提交回复
热议问题