Skip to content

Commit bec9cb3

Browse files
authored
Merge pull request #2201 from tbirdso/xr-emulator-directions
docs(XR): Add discussion on XR emulator
2 parents 70d1703 + 522b46b commit bec9cb3

File tree

9 files changed

+88
-0
lines changed

9 files changed

+88
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
title: WebXR Examples
2+
---
3+
4+
<style>
5+
.categories {
6+
columns: 2 200px;
7+
column-gap: 1rem;
8+
}
9+
10+
.category {
11+
break-inside: avoid;
12+
display: inline-block;
13+
width: 100%;
14+
}
15+
16+
.categories br {
17+
display: none;
18+
}
19+
20+
.category ul {
21+
margin-top: 0;
22+
}
23+
24+
.gallery img {
25+
width: 49%;
26+
display: inline-block;
27+
padding: 2px;
28+
}
29+
30+
.gallery br {
31+
display: none;
32+
}
33+
</style>
34+
35+
vtk.js supports virtual and augmented reality rendering via the [WebXR device API](https://www.w3.org/TR/webxr/) for most standalone and PC headsets.
36+
37+
### Virtual Reality Examples
38+
39+
<div class="gallery">
40+
41+
[![VR Cone Example][VrCone]](../examples/VR.html)
42+
[![SkyboxViewer Example][SkyboxViewerVR]](../examples/SkyboxViewer.html?fileURL=https://data.kitware.com/api/v1/file/5ae8a89c8d777f0685796bae/download)
43+
44+
</div>
45+
46+
### Augmented Reality Examples
47+
48+
<div class="gallery">
49+
50+
[![AR Cone Example][ArCone]](../examples/AR.html)
51+
[![GeometryViewer Example][GeometryViewer]](../examples/GeometryViewer.html?fileURL=https://data.kitware.com/api/v1/item/59de9de58d777f31ac641dc5/download)
52+
53+
</div>
54+
55+
### For Developers
56+
57+
Developers without access to XR hardware may find it convenient to install and use the [Mozilla WebXR emulator](https://github.com/MozillaReality/WebXR-emulator-extension) in their browser.
58+
59+
- Install the WebXR extension on either Chrome or Firefox.
60+
- Close and reopen the browser.
61+
- Press F12 to access the browser console.
62+
- Select the "WebXR" tab to selected XR emulated hardware and view controls.
63+
64+
While WebXR has broad industry support, it is not yet implemented in all browsers. Developers may include the [WebXR polyfill](https://github.com/immersive-web/webxr-polyfill) in their projects for backwards compatibility with the deprecated WebVR API.
65+
66+
67+
[ArCone]: ../docs/gallery/ArCone.jpg
68+
[GeometryViewer]: ../docs/gallery/GeometryViewer.jpg
69+
[SkyboxViewerVR]: ../docs/gallery/SkyboxViewerVR.jpg
70+
[VrCone]: ../docs/gallery/VrCone.jpg
32 KB
Loading
137 KB
Loading
27.7 KB
Loading

Documentation/tpl/__en__

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ sidebar:
2929
class: Create class
3030
example: Create example
3131
webgpu: WebGPU Examples
32+
webxr: WebXR Examples
3233
test: Create test
3334
build: Build library
3435
concepts: Concepts

Documentation/tpl/__sidebar__

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ docs:
1717
build: develop_build.html
1818
widget: develop_widget.html
1919
webgpu: develop_webgpu.html
20+
webxr: develop_webxr.html
2021

2122
concepts:
2223
widgets: concepts_widgets.html

Examples/Applications/SkyboxViewer/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// For streamlined VR development install the WebXR emulator extension
2+
// https://github.com/MozillaReality/WebXR-emulator-extension
3+
14
import 'vtk.js/Sources/favicon';
25

36
// Load the rendering pieces we want to use (for both WebGL and WebGPU)

Examples/Geometry/VR/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// For streamlined VR development install the WebXR emulator extension
2+
// https://github.com/MozillaReality/WebXR-emulator-extension
3+
14
import 'vtk.js/Sources/favicon';
25

36
// Load the rendering pieces we want to use (for both WebGL and WebGPU)

Examples/Geometry/VR/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Viewing Scenes with WebXR
2+
3+
vtk.js supports virtual reality rendering via the [WebXR device API](https://www.w3.org/TR/webxr/) for most standalone and PC headsets.
4+
5+
Developers seeking to develop VR experiences without hardware may make use of the Mozilla WebXR emulator extension at [https://github.com/MozillaReality/WebXR-emulator-extension](https://github.com/MozillaReality/WebXR-emulator-extension) with these installation steps:
6+
7+
- Install the WebXR extension on either Chrome or Firefox.
8+
- Close and reopen the browser.
9+
- Press F12 to access the browser console.
10+
- Select the "WebXR" tab to selected XR emulated hardware and view controls.

0 commit comments

Comments
 (0)