Integrations Guides
Three.js
Usage
3min
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 now, in your scripts you need to define the following model parameters (described in supported parameters) let modelparams = { "path" ' /model sxrweb', "usealpha" true, "usemetalroughness" true, "occlusionculling" true, "equirecenvmap" 'env jpg', "doublesidedmaterials" false, "quality" 1 0, "shadows" false }; you can set only some parameters, or skip this part completely (then the streamer will use the default parameters that are listed in supported parameters https //docs senseofspace io/xxei supported parameters ) 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 let object3d = createstreamablemodel(renderer, scene, camera, modelparams); 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 let modelstreamer = getmodelstreamer(); render = function () { requestanimationframe( render ); if(modelstreamer !== undefined) { modelstreamer updateframe(); } // render the scene renderer render(scene, camera); }; render();