Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Google XR ARCore/Daydream
EOL
ARCore
Copyright @Hirokazu Egashira. All right reserved.
Web
Advances in Web Technology
<video>
<canvas>
WebRTC’s getUserMedia();
WebGL three.jsvideo tag, canvas tag OpenCV + emscripten
WebVR
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Advances in XR Technology [VR]
Copyright @Hirokazu Egashira. All right reserved.
Advances in XR Technology [AR]
ARKit
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Usage
<script src='webxr-polyfill.js'></script>
<!-- or use a link to a CDN -->
<script src='https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxrpolyfill.js'>

</script>
using a build tool (like browserify or webpack)
npm install --save webxr-polyfill
var polyfill = new WebXRPolyfill();
include it as a script tag, or use a CDN
Using
using script tags
import WebXRPolyfill from 'webxr-polyfill';
const polyfill = new WebXRPolyfill();
In a modular ES6 world
Copyright @Hirokazu Egashira. All right reserved.
<!--The polyfill is not needed for browser that have native API support,
but is linked by these samples for wider compatibility.-->
<script src=‘https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js'></
script>
<body>
<header>
<details open>
<summary>Viewport Scaling</summary>
<p>
<a class="back" href="./">Back</a>
</p>
</details>
</header>
</body>
Copyright @Hirokazu Egashira. All right reserved.
(function () {
'use strict';
// If requested, initialize the WebXR polyfill
if (QueryArgs.getBool('allowPolyfill', false)) {
var polyfill = new WebXRPolyfill();
}
// XR globals.
let xrButton = null;
let xrExclusiveFrameOfRef = null;
let xrNonExclusiveFrameOfRef = null;
// WebGL scene globals.
let gl = null;
let renderer = null;
let scene = new Scene();
scene.addNode(new Gltf2Node({url: 'media/gltf/camp/
camp.gltf'}));
scene.addNode(new SkyboxNode({url: 'media/textures/
eilenriede-park-2k.png'}));
scene.standingStats(true);
//
function initXR() {
xrButton = new XRDeviceButton({
onRequestSession: onRequestSession,
onEndSession: onEndSession
});
document.querySelector('header').appendChild(xrButton.domElement);
if (navigator.xr) {
navigator.xr.requestDevice().then((device) => {
device.supportsSession({exclusive: true}).then(() => {
xrButton.setDevice(device);
});
let outputCanvas = document.createElement('canvas');
let ctx = outputCanvas.getContext('xrpresent');
device.requestSession({ outputContext: ctx })
.then((session) => {
document.body.appendChild(outputCanvas);
onSessionStarted(session);
});
}).catch(() => {
initFallback();
});
} else {
initFallback();
}
}
Copyright @Hirokazu Egashira. All right reserved.
// initXR()
function initFallback() {
initGL();
document.body.appendChild(gl.canvas);
let fallbackHelper = new FallbackHelper(scene, gl);
fallbackHelper.emulateStage = true;
}
// initXR()
function onRequestSession(device) {
// Set up a mirror canvas
let mirrorCanvas = document.createElement('canvas');
let ctx = mirrorCanvas.getContext('xrpresent');
mirrorCanvas.setAttribute('id', 'mirror-canvas');
document.body.appendChild(mirrorCanvas);
device.requestSession({ exclusive: true, outputContext:
ctx }).then((session) => {
xrButton.setSession(session);
onSessionStarted(session);
});
}
// initFallback()
function initGL(compatibleDevice) {
if (gl)
return;
gl = createWebGLContext({
compatibleXRDevice: compatibleDevice
});
renderer = new Renderer(gl);
scene.setRenderer(renderer);
}
Copyright @Hirokazu Egashira. All right reserved.
// fire ar initXR() and onRequestSession()
function onSessionStarted(session) {
session.addEventListener('end', onSessionEnded);
initGL(session.device);
session.baseLayer = new XRWebGLLayer(session, gl);
// Get a stage frame of reference, which will align the user's physical
// floor with Y=0 and can provide boundaries that indicate where the
// user can safely walk. If the system can't natively provide stage
// coordinates (for example, with a 3DoF device) then it will return an
// emulated stage, where the view is translated up by a static height
so
// that the scene still renders in approximately the right place.
session.requestFrameOfReference('stage').then((frameOfRef) => {
if (session.exclusive) {
xrExclusiveFrameOfRef = frameOfRef;
let boundsRenderer = new BoundsRenderer();
boundsRenderer.stageBounds = frameOfRef.bounds;
scene.addNode(boundsRenderer);
} else {
xrNonExclusiveFrameOfRef = frameOfRef;
}
session.requestAnimationFrame(onXRFrame);
});
}
// fire at initXR()
function onEndSession(session) {
session.end();
}
// fire at onSessionStarted()
function onSessionEnded(event) {
if (event.session.exclusive) {
document.body.removeChild(document.querySelector('#mirror-
canvas'));
xrButton.setSession(null);
}
}
// fire at onSessionStarted()
function onXRFrame(t, frame) {
let session = frame.session;
let frameOfRef = session.exclusive ?
xrExclusiveFrameOfRef :
xrNonExclusiveFrameOfRef;
let pose = frame.getDevicePose(frameOfRef);
scene.startFrame();
session.requestAnimationFrame(onXRFrame);
// Every XR frame uses basically the same render loop, so for the
sake
// of keeping the sample code focused on the interesting bits most
// samples after this one will start using this helper function to
hide
// away the majority of the rendering logic.
scene.drawXRFrame(frame, pose);
scene.endFrame();
}
Copyright @Hirokazu Egashira. All right reserved.
// Start the XR application.
initXR();
})();
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
https://immersive-web.github.io/webxr-samples/
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
https://github.com/google-ar/WebARonARCore
https://github.com/google-ar/WebARonARKit
Copyright @Hirokazu Egashira. All right reserved.
https://github.com/google-ar/three.ar.js
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.
CD MD
CUI GUI
☓ ☓ ☓ ☓


☓
☓
☓
☓


☓


☓


☓
Copyright @Hirokazu Egashira. All right reserved.
DTM
Copyright @Hirokazu Egashira. All right reserved.
Copyright @Hirokazu Egashira. All right reserved.


Install
Build
Copyright @Hirokazu Egashira. All right reserved.


Copyright @Hirokazu Egashira. All right reserved.




Copyright @Hirokazu Egashira. All right reserved.
References
Copyright @Hirokazu Egashira. All right reserved.
Immersive Web
• https://www.w3.org/community/immersive-web/
• https://github.com/immersive-web
• https://immersive-web.github.io/webxr/
• https://github.com/immersive-web/webxr-samples/
• https://immersive-web.github.io/webxr-reference/
• https://immersive-web.github.io/webvr/
• https://immersive-web.github.io/webxr-samples/
• https://github.com/immersive-web/webxr-polyfill
• https://github.com/immersive-web/webvr-polyfill
• https://immersive-web.github.io/webvr/spec/1.1/
• https://immersive-web.github.io/webxr/charter/
• https://webvr.info/
• https://blog.mozvr.com/progressive-webxr-ar-store/
• https://blog.mozvr.com/experimenting-with-computer-vision-in-webxr/
• https://blog.mozvr.com/experimenting-with-ar-and-the-web-on-ios/
• https://itunes.apple.com/us/app/webxr-viewer/id1295998056?mt=8
• https://github.com/mozilla-mobile/webxr-ios
• https://github.com/mozilla/webxr-polyfill
• https://github.com/mozilla/aframe-xr
• https://mozilla.github.io/aframe-xr/
• https://aframe.io/
Copyright @Hirokazu Egashira. All right reserved.
Mozilla Web XR
References
Copyright @Hirokazu Egashira. All right reserved.
• https://developers.google.com/ar/develop/web/quickstart
• https://github.com/google-ar/WebARonARCore
• https://github.com/google-ar/WebARonARKit
• https://github.com/google-ar/three.ar.js
• https://github.com/google-ar/WebAR-Article
• https://github.com/google-ar/three.ar.js/issues/82
• https://youtu.be/1t1gBVykneA
• https://www.chromestatus.com/feature/5680169905815552
• https://developers.google.com/ar/
• https://poly.google.com
Google WebXR
References
Copyright @Hirokazu Egashira. All right reserved.
• https://designguidelines.withgoogle.com/ar-design/augmented-reality-design-guidelines/introduction-to-ar-arcore.html
• https://blog.google/products/google-vr/best-practices-mobile-ar-design/
• https://developer.apple.com/design/human-interface-guidelines/ios/system-capabilities/augmented-reality/
UI Guideline
Others
• https://www.khronos.org/openxr
• https://developer.apple.com/safari/whats-new/
• https://github.com/dontcallmedom/html5-augmented-reality
• https://github.com/google/draco
References
• https://github.com/jcmellado/js-aruco
• https://github.com/artoolkit/jsartoolkit5
• https://github.com/jeromeetienne/AR.js
• https://github.com/awe-media/awe.js/
• https://www.argonjs.io/
Copyright @Hirokazu Egashira. All right reserved.
• https://facebook.github.io/react-360/
• https://github.com/facebook/react-360
• https://www.nativescript.org/blog/preview-of-augmented-reality-in-nativescript
• https://www.nativescript.org/blog/getting-started-with-augmented-reality-in-nativescript
• https://github.com/EddyVerbruggen/nativescript-ar
JavaScript Library for XR
JavaScript Framework for XR
References

Introduction to Immersive Web

  • 2.
    Copyright @Hirokazu Egashira.All right reserved.
  • 3.
    Copyright @Hirokazu Egashira.All right reserved.
  • 4.
    Copyright @Hirokazu Egashira.All right reserved. Google XR ARCore/Daydream EOL ARCore
  • 5.
    Copyright @Hirokazu Egashira.All right reserved.
  • 7.
  • 8.
    Advances in WebTechnology <video> <canvas> WebRTC’s getUserMedia(); WebGL three.jsvideo tag, canvas tag OpenCV + emscripten WebVR Copyright @Hirokazu Egashira. All right reserved.
  • 9.
    Copyright @Hirokazu Egashira.All right reserved. Advances in XR Technology [VR]
  • 10.
    Copyright @Hirokazu Egashira.All right reserved. Advances in XR Technology [AR] ARKit
  • 12.
    Copyright @Hirokazu Egashira.All right reserved.
  • 13.
    Copyright @Hirokazu Egashira.All right reserved.
  • 14.
    Copyright @Hirokazu Egashira.All right reserved.
  • 15.
    Copyright @Hirokazu Egashira.All right reserved.
  • 16.
    Copyright @Hirokazu Egashira.All right reserved.
  • 17.
    Copyright @Hirokazu Egashira.All right reserved.
  • 18.
    Copyright @Hirokazu Egashira.All right reserved.
  • 19.
    Copyright @Hirokazu Egashira.All right reserved.
  • 20.
    Copyright @Hirokazu Egashira.All right reserved.
  • 21.
    Copyright @Hirokazu Egashira.All right reserved.
  • 22.
    Copyright @Hirokazu Egashira.All right reserved.
  • 23.
    Copyright @Hirokazu Egashira.All right reserved.
  • 25.
    Copyright @Hirokazu Egashira.All right reserved.
  • 26.
    Copyright @Hirokazu Egashira.All right reserved.
  • 27.
    Copyright @Hirokazu Egashira.All right reserved.
  • 28.
    Usage <script src='webxr-polyfill.js'></script> <!-- oruse a link to a CDN --> <script src='https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxrpolyfill.js'>
 </script> using a build tool (like browserify or webpack) npm install --save webxr-polyfill var polyfill = new WebXRPolyfill(); include it as a script tag, or use a CDN Using using script tags import WebXRPolyfill from 'webxr-polyfill'; const polyfill = new WebXRPolyfill(); In a modular ES6 world
  • 30.
    Copyright @Hirokazu Egashira.All right reserved. <!--The polyfill is not needed for browser that have native API support, but is linked by these samples for wider compatibility.--> <script src=‘https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js'></ script> <body> <header> <details open> <summary>Viewport Scaling</summary> <p> <a class="back" href="./">Back</a> </p> </details> </header> </body>
  • 31.
    Copyright @Hirokazu Egashira.All right reserved. (function () { 'use strict'; // If requested, initialize the WebXR polyfill if (QueryArgs.getBool('allowPolyfill', false)) { var polyfill = new WebXRPolyfill(); } // XR globals. let xrButton = null; let xrExclusiveFrameOfRef = null; let xrNonExclusiveFrameOfRef = null; // WebGL scene globals. let gl = null; let renderer = null; let scene = new Scene(); scene.addNode(new Gltf2Node({url: 'media/gltf/camp/ camp.gltf'})); scene.addNode(new SkyboxNode({url: 'media/textures/ eilenriede-park-2k.png'})); scene.standingStats(true); // function initXR() { xrButton = new XRDeviceButton({ onRequestSession: onRequestSession, onEndSession: onEndSession }); document.querySelector('header').appendChild(xrButton.domElement); if (navigator.xr) { navigator.xr.requestDevice().then((device) => { device.supportsSession({exclusive: true}).then(() => { xrButton.setDevice(device); }); let outputCanvas = document.createElement('canvas'); let ctx = outputCanvas.getContext('xrpresent'); device.requestSession({ outputContext: ctx }) .then((session) => { document.body.appendChild(outputCanvas); onSessionStarted(session); }); }).catch(() => { initFallback(); }); } else { initFallback(); } }
  • 32.
    Copyright @Hirokazu Egashira.All right reserved. // initXR() function initFallback() { initGL(); document.body.appendChild(gl.canvas); let fallbackHelper = new FallbackHelper(scene, gl); fallbackHelper.emulateStage = true; } // initXR() function onRequestSession(device) { // Set up a mirror canvas let mirrorCanvas = document.createElement('canvas'); let ctx = mirrorCanvas.getContext('xrpresent'); mirrorCanvas.setAttribute('id', 'mirror-canvas'); document.body.appendChild(mirrorCanvas); device.requestSession({ exclusive: true, outputContext: ctx }).then((session) => { xrButton.setSession(session); onSessionStarted(session); }); } // initFallback() function initGL(compatibleDevice) { if (gl) return; gl = createWebGLContext({ compatibleXRDevice: compatibleDevice }); renderer = new Renderer(gl); scene.setRenderer(renderer); }
  • 33.
    Copyright @Hirokazu Egashira.All right reserved. // fire ar initXR() and onRequestSession() function onSessionStarted(session) { session.addEventListener('end', onSessionEnded); initGL(session.device); session.baseLayer = new XRWebGLLayer(session, gl); // Get a stage frame of reference, which will align the user's physical // floor with Y=0 and can provide boundaries that indicate where the // user can safely walk. If the system can't natively provide stage // coordinates (for example, with a 3DoF device) then it will return an // emulated stage, where the view is translated up by a static height so // that the scene still renders in approximately the right place. session.requestFrameOfReference('stage').then((frameOfRef) => { if (session.exclusive) { xrExclusiveFrameOfRef = frameOfRef; let boundsRenderer = new BoundsRenderer(); boundsRenderer.stageBounds = frameOfRef.bounds; scene.addNode(boundsRenderer); } else { xrNonExclusiveFrameOfRef = frameOfRef; } session.requestAnimationFrame(onXRFrame); }); } // fire at initXR() function onEndSession(session) { session.end(); } // fire at onSessionStarted() function onSessionEnded(event) { if (event.session.exclusive) { document.body.removeChild(document.querySelector('#mirror- canvas')); xrButton.setSession(null); } } // fire at onSessionStarted() function onXRFrame(t, frame) { let session = frame.session; let frameOfRef = session.exclusive ? xrExclusiveFrameOfRef : xrNonExclusiveFrameOfRef; let pose = frame.getDevicePose(frameOfRef); scene.startFrame(); session.requestAnimationFrame(onXRFrame); // Every XR frame uses basically the same render loop, so for the sake // of keeping the sample code focused on the interesting bits most // samples after this one will start using this helper function to hide // away the majority of the rendering logic. scene.drawXRFrame(frame, pose); scene.endFrame(); }
  • 34.
    Copyright @Hirokazu Egashira.All right reserved. // Start the XR application. initXR(); })();
  • 36.
    Copyright @Hirokazu Egashira.All right reserved.
  • 37.
    Copyright @Hirokazu Egashira.All right reserved.
  • 38.
    Copyright @Hirokazu Egashira.All right reserved.
  • 39.
    Copyright @Hirokazu Egashira.All right reserved. https://immersive-web.github.io/webxr-samples/
  • 40.
    Copyright @Hirokazu Egashira.All right reserved.
  • 41.
    Copyright @Hirokazu Egashira.All right reserved.
  • 42.
    Copyright @Hirokazu Egashira.All right reserved.
  • 43.
    Copyright @Hirokazu Egashira.All right reserved.
  • 44.
    Copyright @Hirokazu Egashira.All right reserved.
  • 45.
    Copyright @Hirokazu Egashira.All right reserved.
  • 46.
    Copyright @Hirokazu Egashira.All right reserved.
  • 48.
    Copyright @Hirokazu Egashira.All right reserved.
  • 49.
    Copyright @Hirokazu Egashira.All right reserved.
  • 50.
    Copyright @Hirokazu Egashira.All right reserved.
  • 53.
    Copyright @Hirokazu Egashira.All right reserved. https://github.com/google-ar/WebARonARCore https://github.com/google-ar/WebARonARKit
  • 54.
    Copyright @Hirokazu Egashira.All right reserved. https://github.com/google-ar/three.ar.js
  • 55.
    Copyright @Hirokazu Egashira.All right reserved.
  • 57.
    Copyright @Hirokazu Egashira.All right reserved.
  • 58.
    Copyright @Hirokazu Egashira.All right reserved.
  • 59.
    Copyright @Hirokazu Egashira.All right reserved.
  • 60.
    Copyright @Hirokazu Egashira.All right reserved.
  • 61.
    Copyright @Hirokazu Egashira.All right reserved.
  • 64.
    Copyright @Hirokazu Egashira.All right reserved.
  • 65.
    Copyright @Hirokazu Egashira.All right reserved.
  • 67.
    Copyright @Hirokazu Egashira.All right reserved.
  • 68.
    Copyright @Hirokazu Egashira.All right reserved. CD MD CUI GUI ☓ ☓ ☓ ☓ 
 ☓ ☓ ☓ ☓ 
 ☓ 
 ☓ 
 ☓
  • 69.
    Copyright @Hirokazu Egashira.All right reserved. DTM
  • 70.
    Copyright @Hirokazu Egashira.All right reserved.
  • 71.
    Copyright @Hirokazu Egashira.All right reserved. 
 Install Build
  • 72.
    Copyright @Hirokazu Egashira.All right reserved. 

  • 73.
    Copyright @Hirokazu Egashira.All right reserved.
  • 75.
  • 78.
    References Copyright @Hirokazu Egashira.All right reserved. Immersive Web • https://www.w3.org/community/immersive-web/ • https://github.com/immersive-web • https://immersive-web.github.io/webxr/ • https://github.com/immersive-web/webxr-samples/ • https://immersive-web.github.io/webxr-reference/ • https://immersive-web.github.io/webvr/ • https://immersive-web.github.io/webxr-samples/ • https://github.com/immersive-web/webxr-polyfill • https://github.com/immersive-web/webvr-polyfill • https://immersive-web.github.io/webvr/spec/1.1/ • https://immersive-web.github.io/webxr/charter/ • https://webvr.info/
  • 79.
    • https://blog.mozvr.com/progressive-webxr-ar-store/ • https://blog.mozvr.com/experimenting-with-computer-vision-in-webxr/ •https://blog.mozvr.com/experimenting-with-ar-and-the-web-on-ios/ • https://itunes.apple.com/us/app/webxr-viewer/id1295998056?mt=8 • https://github.com/mozilla-mobile/webxr-ios • https://github.com/mozilla/webxr-polyfill • https://github.com/mozilla/aframe-xr • https://mozilla.github.io/aframe-xr/ • https://aframe.io/ Copyright @Hirokazu Egashira. All right reserved. Mozilla Web XR References
  • 80.
    Copyright @Hirokazu Egashira.All right reserved. • https://developers.google.com/ar/develop/web/quickstart • https://github.com/google-ar/WebARonARCore • https://github.com/google-ar/WebARonARKit • https://github.com/google-ar/three.ar.js • https://github.com/google-ar/WebAR-Article • https://github.com/google-ar/three.ar.js/issues/82 • https://youtu.be/1t1gBVykneA • https://www.chromestatus.com/feature/5680169905815552 • https://developers.google.com/ar/ • https://poly.google.com Google WebXR References
  • 81.
    Copyright @Hirokazu Egashira.All right reserved. • https://designguidelines.withgoogle.com/ar-design/augmented-reality-design-guidelines/introduction-to-ar-arcore.html • https://blog.google/products/google-vr/best-practices-mobile-ar-design/ • https://developer.apple.com/design/human-interface-guidelines/ios/system-capabilities/augmented-reality/ UI Guideline Others • https://www.khronos.org/openxr • https://developer.apple.com/safari/whats-new/ • https://github.com/dontcallmedom/html5-augmented-reality • https://github.com/google/draco References
  • 82.
    • https://github.com/jcmellado/js-aruco • https://github.com/artoolkit/jsartoolkit5 •https://github.com/jeromeetienne/AR.js • https://github.com/awe-media/awe.js/ • https://www.argonjs.io/ Copyright @Hirokazu Egashira. All right reserved. • https://facebook.github.io/react-360/ • https://github.com/facebook/react-360 • https://www.nativescript.org/blog/preview-of-augmented-reality-in-nativescript • https://www.nativescript.org/blog/getting-started-with-augmented-reality-in-nativescript • https://github.com/EddyVerbruggen/nativescript-ar JavaScript Library for XR JavaScript Framework for XR References