Getting Started
Installation
Install the component together with its peer dependencies:
Minimal example
Read a local file as an ArrayBuffer and pass it to model-data:
The model is placed on the floor (y = 0) and the camera is moved so the whole model is in view.
Tip
Setting model-data to a new buffer replaces the current model. Setting it to undefined unloads it.
Loading from a server
Mind the asset licenses
Unless you hold the copyright to the model and all of its assets (textures and so on), do not implement code that loads the actual file directly — for example from a public URL or from a file bundled with your app. See Examples for how to deliver files safely.
Fetch the bytes and read the response as an ArrayBuffer:
See Examples for server code that serves model files without exposing them as public URLs.