WebXR
Let's turn the Internet Holographic.
Last updated
Was this helpful?
Let's turn the Internet Holographic.
Last updated
Was this helpful?
The Looking Glass WebXR Library is open source and originally developed by . We're excited to continue working in and supporting open-source technology! If you're interested in contributing check out the library on .
In order to use Looking Glass WebXR with your Looking Glass you must install Looking Glass Bridge ->
The Looking Glass WebXR Library provides a WebXR API for targeting Looking Glass displays, this means that any 3D web framework that supports WebXR will work with the Looking Glass WebXR library. Ready to turn the internet holographic? Let's have some fun!
We've tested our WebXR Library with the following WebGL frameworks. If you use one and don't see it here, reach out on discord! We'd love to support as many as possible, it's likely yours may work too!
Three.JS (v141+)
Babylon.JS (v5.0+)
PlayCanvas
To view a WebXR project on your Looking Glass you'll need to click the "View in XR" button.
This will open up a small pop-up window.
Drag this over to your Looking Glass display and then double click to have the hologram display properly.
Developing with the Looking Glass WebXR Library is really straightforward.
Install the Looking Glass WebXR Library and paste the following snippet in to your WebXR project. Now your project supports the Looking Glass.
There are two main imports you'll need to import as follows:
import {LookingGlassWebXRPolyfill, LookingGlassConfig }from "@lookingglass/webxr"
Once you've imported the packages you'll need to define both the LookingGlassConfig as well as the LookingGlassWebXRPolyfill.
The LookingGlassConfig
controls the holographic camera and has the following properties:
quiltResolution.width
- defines the resolution of the quilt's width
quiltResolution.height
- defines the resolution of the quilt's height
columns
- defines the number of columns in the quilt
rows
- defines the number of rows in the quilt
targetX
- defines the position of the camera on the X-axis
targetY
- defines the position of the camera on the Y-axis
targetZ
- defines the position of the camera on the Z-axis
trackballX
- defines the rotation of the camera on the X-axis
trackballZ
- defines the rotation of the camera on the Z-axis
targetDiam
- defines the size of the camera, this makes your scene bigger or smaller without changing the focus.
fovy
- defines the vertical FOV of your camera (defined in radians)
depthiness
- modifies to the view frustum to increase or decrease the perceived depth of the scene.
inlineView
- changes how the original canvas on your main web page is displayed, can show the encoded subpixel matrix, a single centered view, or a quilt view.
The LookingGlassWebXRPolyfill
implements the WebXR override and allows you to target the Looking Glass.
Since Looking Glass WebXR is engine agnostic there are a few settings that will be the same regardless of what 3D engine you're working with.
You can import the Looking Glass WebXR library by running the following command in your web project.
or, if you use the yarn package manager.
You can also use a <script>
tag, like shown in the following examples:
We've got some demos setup for three.js, react-three-fiber, and Spline! Check them out on the following pages!
This library is published on you can install it by running npm install @lookingglass/webxr