Janis3k downloadsView and embed interactive 3D models directly in your vault, powered by Google's <model-viewer> component. Supports the glTF and GLB file formats.
This plugin allows you to view and embed interactive 3D models directly in your Obsidian vault, powered by Google’s <model-viewer> component.

<model-viewer> supports and plans to support only glTF/GLB 3D models. It is the Khronos standard known as the JPEG of 3D and the first format to standardize Physically-Based Rendering (PBR), making your models look realistic under any lighting, on any renderer. It is also compact, compressible, and loads rapidly into the GPU.
Using this plugin, Obsidian automatically recognizes the .glb and .gltf files in your vault, allowing you to browse them and open them in a tab.
When combined with Obsidian's page preview plugin (enabled by default), you can view 3D models using the hover preview.
You can embed 3D models in your notes using Obsidian's native embed syntax. This allows you to view and interact with the models directly within your notes.
The simplest embed looks like this:
![[DamagedHelmet.glb]]
If you want to specify the height of the model, you can do so like this:
![[Duck.glb#height=400]]
Or alternatively, you can specify the aspect ratio:
![[Sponza.gltf#aspect=16:9]]
The embed will automatically fill the entire width of the container. As with other embed types, you can also specify the width after the pipe character:
![[StainedGlassLamp.gltf#aspect=1|320]]
You can even place models side by side on a single line:
![[A.glb|160]] ![[B.glb|160]] ![[C.glb|160]]
For more complex embeds, use a model-viewer code block. It takes src and the same options as an embed, written as YAML. It can also add annotations to the model:
```model-viewer
src: Thor.glb
aspect: 16:9
auto-rotate: true
annotations:
- position: "-0.0569m 0.0969m -0.1398m"
normal: "-0.5829775m 0.2863482m -0.7603565m"
text: "[[The Fighters]] at sea"
```
Annotations appear as rings on the model. Hovering over one shows the first paragraph of its text, which you can move the pointer onto to follow its links, and clicking it shows the full text. The text can use Markdown, including links. The <model-viewer> editor can help you find positions and normals.
src and a text that is only a link can be written as [[name]], with or without quotes. Text with more than a link needs quotes, as YAML would otherwise read the brackets as a list.src, annotations, aspect, height and overlay are options of the plugin. Every other key is passed to <model-viewer> as an attribute, except event handlers such as onclick.id. Without a normal, it faces up (0m 1m 0m).You can also use any of the attributes supported by the <model-viewer> component. To do this, you can use the following syntax:
![[Fox.glb#autoplay&camera-controls=false&camera-orbit=30deg+80deg+80%]]
The documentation for all available attributes can be found here: https://modelviewer.dev/docs/index.html
Defaults for all models, the file view and embeds can be edited in the plugin settings.
To build an embed visually, open a model and run the Customize embed command. It lets you frame the model in a live preview, try out attributes and copy the finished embed.
The plugin doesn't collect data or contact any server on its own. It fetches only what your models and embeds reference: the model file, its textures and buffers, and any images you set in attributes such as skybox-image or poster. Files in your vault are loaded locally. If a model or attribute points to a URL on the web, that URL is fetched.
main.js includes these decoders. At load, the plugin writes them into its own folder (.obsidian/plugins/model-viewer/lib/) and <model-viewer> loads them from there, rather than from Google's servers:
| File | What it decodes | Source |
|---|---|---|
lib/draco/draco_decoder.wasm, draco_wasm_wrapper.js |
Draco-compressed meshes | Draco 1.5.9 |
lib/basis/basis_transcoder.wasm, basis_transcoder.js |
KTX2/Basis Universal textures | Basis Universal, as shipped with three.js r183 |
meshopt-compressed meshes are decoded by the meshoptimizer decoder that three.js includes in main.js. <model-viewer> still loads a script before it uses that decoder, so lib/meshopt_decoder.js is a placeholder without code.
Automated scans of main.js may also report the following. They come from <model-viewer> and three.js:
lib/meshopt_decoder.js, and a JSON-LD element for structured data if the generate-schema attribute is set.