|
|
@@ -12,8 +12,14 @@
|
|
|
|
|
|
window.initThreeJS = init;
|
|
|
|
|
|
+ var id = null;
|
|
|
+
|
|
|
function init() {
|
|
|
|
|
|
+ if(id !== null){
|
|
|
+ cancelAnimationFrame(id);
|
|
|
+ }
|
|
|
+
|
|
|
canvas = document.getElementById("c");
|
|
|
|
|
|
const content = document.getElementById('content');
|
|
|
@@ -207,7 +213,7 @@
|
|
|
function animate() {
|
|
|
|
|
|
render();
|
|
|
- requestAnimationFrame(animate);
|
|
|
+ id = requestAnimationFrame(animate);
|
|
|
|
|
|
}
|
|
|
|