Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Google ARが提供する WebAR 101
1.
2. Who are U?
Hirokazu Egashira (eegozilla)
html5j
html5j
html5j Web
Android
LeapMotion Developers JP
GoogleARhirokazu.egashira
eegozilla (@ega1979)
Copyright @Hirokazu Egashira. All right reserved.
8. Advances in Web Technology for Augument Reality
<video>
<canvas>
WebRTC’s getUserMedia();
WebGL three.jsvideo canvas OpenCV + emscripten
WebVR
Copyright @Hirokazu Egashira. All right reserved.
9. W3C Augument Reality Community Group
Copyright @Hirokazu Egashira. All right reserved.
2011 W3C Community
10. Build Augument Reality Experience with Web
getUserMedia three.js Web AR
JS ARToolkit 5
js-aruco
AR.js
Argon
etc
Copyright @Hirokazu Egashira. All right reserved.
11. AR Library_01 JS ARToolkit 5
JavaScript AR JavaScript ARToolkit Java NyARtoolkit
FLASH FLARToolkit
5 ARToolkit Emscripten Asm.js JavaScript
Copyright @Hirokazu Egashira. All right reserved.
12. cf.(1)The case of loading image
Copyright @Hirokazu Egashira. All right reserved.
17. AR Library_03 AR.js
ARToolkit Emscripten asm.js JavaScript 3D three.js
Alexandra Etienne Jerome Etienne JavaScript AR
Github A-frame WebVR Polyfill babylon.js
Copyright @Hirokazu Egashira. All right reserved.
18. cf. Using three.js API
Copyright @Hirokazu Egashira. All right reserved.
25. cf. Using A-frame API
Copyright @Hirokazu Egashira. All right reserved.
26. AR Library_04 Argon.js with Argon4
Copyright @Hirokazu Egashira. All right reserved.
Web AR JavaScript
iOS/Android Argon4 WebAR
Vurofia A-frame TypeScript
33. Advances in Web Technology
<video>
<canvas>
WebRTC’s getUserMedia();
WebGL three.jsvideo canvas OpenCV + emscripten
WebVR
Copyright @Hirokazu Egashira. All right reserved.
34. Google & Apple AR Technology
Copyright @Hirokazu Egashira. All right reserved.
ARKit
35. Google AR’s Web AR
three.ar.js JS Web AR
ARCore Tango (Android) ARKit (iOS)
three.ar.js
WebARonARCore
WebARonARkit
https://github.com/google-ar/WebARonARCore
https://github.com/google-ar/three.ar.js
https://github.com/google-ar/WebARonARKit
WebARonTango
https://github.com/google-ar/WebARonTango
Copyright @Hirokazu Egashira. All right reserved.
36. Tools for building Google Web AR
• three.js
• three.ar.js
• WebVR API
•
ARCore Pixel, Pixel XL, Pixel2, Pixel2 XL, Galaxy S8
* Hack Nexus 6P ARCore WebARonARCore
Tango ZenfoneAR, Phab 2 Pro, Yellow Stone(Dev Kit)
ARKit iPad (2017) / iPad Pro (9.7, 10.5 or 12.9 inches) /iPhone 7 and 7 Plus / iPhone8 / iPhone X
• Core Process ARCore or Tango ※iPhone/iPad
•
WebGL & GLSL
Draco
emscripten
AR AR.js
Copyright @Hirokazu Egashira. All right reserved.
37. “three.ar.js” with WebAR on ARCore/Tango/ARKit
Copyright @Hirokazu Egashira. All right reserved.
38. Install the External Browser
Copyright @Hirokazu Egashira. All right reserved.
- Tango / ARCore Devices
1) Core ※Tango Tango Core
Android PC
adb
2)
Android PC
adb
※
Android PC
adb
※
- Tango Devices
- ARCore Devices
39. Install the External Browser
Copyright @Hirokazu Egashira. All right reserved.
- iOS Devices
• iOS11
• Xcode 9
• Apple Developer
• WebARonARKit GitHub clone
• Xcode 9
• clone .xcodeproj
• Project Navigator WebARonARKit ’target’ WebARonARKit
• ”General” signing Team iOS Developer Account / Team
• PC iOS Product >> Destination Run
• Run ”Command+R”
40. How to install and use
path
path
- CDN
-
Copyright @Hirokazu Egashira. All right reserved.
42.
How to use init
Copyright @Hirokazu Egashira. All right reserved.
43. How to use update
Copyright @Hirokazu Egashira. All right reserved.
44. How to install and use [module]
How to use [ ES6 ] ※
Copyright @Hirokazu Egashira. All right reserved.
45. ARCore application development stack [Referred from Tango App]
ARCore Service [= Tango]
Unity SDK
Unity App UE App
UE SDK
Java Helper Library
Java App
AIDL
User App
Process
ARCore Process
IBinderInterdace
Native API
Copyright @Hirokazu Egashira. All right reserved.
46. WebAR application development stack
ARCore Service
* arcore-preview.apk
Java Helper
Library
Java App
AIDL
Core
Process
Java App
Tango Service
* Tango Core.apk
Web App [ with three.ar.js + three.js(WebGL) + WebVR ]
Swift / Object-C
App
[WKWebview]User App
Process
WebAR
onARkit
WebAR
onTango
WebAR
onARCore
Copyright @Hirokazu Egashira. All right reserved.
Chromium
[Native]
Java Helper
Library
AIDL
Chromium
[Native]
WebKitARKit
TangoSDK ARCoreSDK
ARKit Process
※
Web
47. WebAR application development stack
ARCore Service
* arcore-preview.apk
Java Helper
Library
Java App
AIDL
Core
Process
Java App
Tango Service
* Tango Core.apk
Web App [ with three.ar.js + three.js(WebGL) + WebVR ]
ARKit Process
※
Swift / Object-C
App
[WKWebview]User App
Process
WebAR
onARkit
WebAR
onTango
WebAR
onARCore
Copyright @Hirokazu Egashira. All right reserved.
Chromium
[Native]
Java Helper
Library
AIDL
Chromium
[Native]
WebKitARKit
TangoSDK ARCoreSDK
Web
Camera Data Camera Data3D Sensor Data
※
48. API overview of three.ar.js
• THREE.ARUtils
• new THREE.ARView(vrDisplay, renderer)
• new THREE.ARReticle(vrDisplay, innerRadius, outerRadius, color, easing)
• new THREE.ARDebug(vrDisplay, scene, config)
• new THREE.ARPerspectiveCamera(vrDisplay, fov, aspect, near, far)
Copyright @Hirokazu Egashira. All right reserved.
49. THREE.ARUtils
※
Promise<VRDisplay> THREE.ARUtils.getARDisplay()
<HTML Element> boolean THREE.ARUtils.isARDisplay(vrDisplay)
boolean THREE.ARUtils.isTango(vrDisplay)
boolean THREE.ARUtils.isARKit(vrDisplay)
AR VRDisplay promise.resolve
null .
VRDisplay AR
※ getARDisplay()
VRDisplay Tango ARCore Android
※ isARDisplay()
VRDisplay ARKit iOS
※ isARDisplay()
Copyright @Hirokazu Egashira. All right reserved.
54. new THREE.ARView(vrDisplay, renderer)
• VRDisplay THREE.WebGLRenderer ARView
• VRDisplay
• ARCore ARKit Scene
render()
Scene
Copyright @Hirokazu Egashira. All right reserved.
onWindowResize()
ARView
56. new THREE.ARPerspectiveCamera(vrDisplay, fov, aspect, near, far)
• THREE.PerspectiveCamera
• AR three.js
• VrDisplay AR
THREE.PerspectiveCamera
• AR ARCore/ARkit/Tango projectionMatrix for
aspect near far
.getProjectionMatrix()
• VRDisplay API
※ getProjectionMatrix() updateProjectionMatrix()
Copyright @Hirokazu Egashira. All right reserved.
.updateProjectionMatrix()
• near/far