4min

Usage

To use the Sense of Space geometry streaming in Three.js, you need to include the following script tag in your html in addition to your ThreeJS:

HTML
|



Now, in your scripts you need to define the following model parameters (described in Supported Parameters) :

JS
|

You can set only some parameters, or skip this part completely (then the streamer will use the default parameters - that are listed below).



Now you can add one or more streamable models to your scene by calling createStreamableModel with your Three.js renderer, scene, camera and optionally your own model parameters as parameters:

JS
|



After this you need to get the modelStreamer object, which is automatically created when the first streamable model is created, and call its update function inside your render loop. E.g.

JS
|







Updated 30 Jun 2022
Did this page help you?
Yes
No