Browse Source

fix example

`sceneRenderFunction` is a void function that animate that scene.
Seemspyo 5 years ago
parent
commit
06dc49e2c6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      threejs/lessons/threejs-multiple-scenes.md

+ 2 - 2
threejs/lessons/threejs-multiple-scenes.md

@@ -432,7 +432,7 @@ document.querySelectorAll('[data-diagram]').forEach((elem) => {
   const sceneName = elem.dataset.diagram;
   const sceneInitFunction = sceneInitFunctionsByName[sceneName];
   const sceneRenderFunction = sceneInitFunction(elem);
-  addScene(elem, sceneRenderFunction());
+  addScene(elem, sceneRenderFunction);
 });
 ```
 
@@ -684,4 +684,4 @@ The result looks the same
 One other advantage to this solution is you could potentially use
 [`OffscreenCanvas`](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas)
 to render from a web worker and still use this technique. Unfortunately as of July 2020
-`OffscreenCanvas` is only supported by Chrome.
+`OffscreenCanvas` is only supported by Chrome.