> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperwisor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 3D Viewer

> Display and orient a single 3D model (STL / OBJ / GLTF / GLB).

<Info>
  **Category:** Display · **Reads data:** yes (model + orientation) · **Sends commands:** no
</Info>

## Mental model

A **3D Viewer is a model turntable.** Load a 3D model and orbit/zoom it — a live,
interactive product or part view. Drive its rotation from a device for a real-time
digital representation.

## When to use it

* Show a product or part in 3D
* Reflect a device's orientation on a model

## Settings

### General / Style

* **Model URL** · **model color**
* **Enable controls** (rotate / zoom / pan) · **auto rotate**
* **Show grid** · **axes**
* **Camera X / Y / Z**

<Note>
  On first drop, the viewer shows a **sample cube** so it's interactive immediately —
  replaced automatically once you set a model URL.
</Note>

## Example — set the model from firmware

```cpp theme={null}
device.update3DModel(targetId, "viewer", "https://.../part.glb");
```

## Script API example

The same interactions from a [dashboard script](/script/overview):

```js theme={null}
// Orient the model live — value accepts roll / pitch / yaw / modelUrl / autoRotate
ws.onMessage((msg) => {
  if (msg.roll !== undefined) {
    widget.setValue('viewer', { roll: msg.roll, pitch: msg.pitch });
  }
});
```

<Card title="3D Virtual Twin" icon="cubes" href="/dashboard/widgets/virtual-twin">
  A multi-model scene with lighting for digital twins.
</Card>
