SlideShare a Scribd company logo
AirTap & Spatial Mapping
HoloLens Programming Tutorial:
Development Tools
Development environment:Unity
 Game engine and development environment for multi-platform
 You can visually place CGs and add functions by using GUI
 Interactive behavior can be described in C# or javascript
 HoloLens is supported from Unity 5.5
Development support tool::HoloToolkit
 Toolkit to support the development of HoloLens compatible systems
 You can use AirTap and cursor behavior, spatial mapping easily
 Various sample programs are provided
 Also provides functions such as moving viewpoint on Unity editor
It is possible to develop without HoloLens or emulator
2
Goal of this tutorial
YouTube → https://youtu.be/_BmbL4yw8R0
3
First of all, the basic operation of Unity
4
Create a project
(1) Extract HoloToolkit-Unity-master.zip to any directory
(2) After starting Unity, click OPEN at the upper right of the screen
OPEN
5
Create a project
Open HoloToolkit-Unity-masterfolder and click [folder selection]
HoloToolkit-Unity-master
Select folder
HoloToolkit-Unity-master
6
Unity operation screen (overview)
Game space design area
Name list of objects
placed in space
List of Asset (CG, program, etc.) added to the project 7
Let's add CG to the game space
Right click
3D Object→Cube
8
Let's run
Click and run
Click to Exit
Space seen from
a camera
9
Adjust the position, orientation and size of the object
Click and select
move rotate zoom in / out
10
Let's change the perspective of Scene
[←][→] -Move left and right
[↑] [↓] -Zoom in/out
[Alt] + drag -Rotation
Other thingshttp://goo.gl/Lq1ILT
→ http://goo.gl/Lq1ILT
11
Designation of CG position/ size using numerical values
Click
Change Position to 0 0 1.2 Change all scale to 0.15
※ The unit of position and size is meter
Inspector(≒Detailed Information
12
Editing CG detailed information :color setting (1/3)
②Right click
③ Create
Make detailed material to set colour and texture
④ Material
①Assets
13
Editing CG detailed information: color setting (2/3)
Edit colour (Albedo) of the created material
(2) Click on the white area next
to Albedo and select a color
(1) Select created material
14
Editing CG detailed information: colour setting (3/3)
Open the material of the Cube to assign the created material
(2) Top of Materials▼
(1)Cube
(3) Drag and drop to
Element 0 review
15
Check
It is OK if the colour is reflected. You can change the colour later.
16
Setting the influence of gravity
Add Component
選択
RigidBody
17
Operation check and fine adjustment
Let's run it
When Cube looks smaller, change Position of MainCame to 0, 0, 0
18
Creation of ground
Click right
3D Object→Plane
19
Adjust the ground position
Plane
Change Position to 0 -0.8 0
20
Save Scene
Scene Name
 Open the dialog with [Ctrl] + [s] and save with your favourite name
 Frequently save during content creation
21
Development using HoloToolKit
22
Setting HoloLens Camera
Delete Main Camera
23
Adding HoloLens Camera
(1) Assets → HoloToolkit → Input → Prefabs
(2)Drag & Drop HoloLens Camera
24
Check
Light & Left by[←] [→]
Forward & Backword by[↑] [↓]
Up & down by[Q] [E]
Rotation by right click + mouse move
25
Supplement: Adjust movement / rotation sensitivity
(1) Select operation content
KeyboardXZTranslation
(2) Sensitivity Scale to 2
(3) Axis Type to Keyboard Arrows
Amount of movement when pushing keys :↑↓← → , will become less than the default
26
Spatial recognition using SpatialMapping
Remove Plane
27
Spatial recognition using SpatialMapping
Assets → HoloToolkit → SpatialMapping → Prefabs
Drag & drop SpatialMapping
28
Operation
Space is recognized by actual HoloLens, but not by PC
29
Importing a space model (official sample)
② Assets → HoloToolkit → SpatialMapping → Tests → Meshes
③ Drag & drop SRMesh into Room Model
① Spatial Mapping
30
Importing a space model (official sample)
(1)Run
The model of the room is displayed
More simplified one provided instead of more complexed one 31
A room for use
32
Import of space model (for study group)
Assets
→ Import New Asset
→ isit.obj
Import spatial model (isit.obj) prepared as sample
33
Import of space model
(2)SpatialMapping
(3) Drag & drop into Room Model
(1)Assets
34
Change appearance of mesh
Click button next to
Surface Material SpatialMappingWireframe
Before After
35
Create and drop Cube at the same time as AirTap
What to do next
36
Add function to manage input operations such as AirTap
(1)HoloToolkit → Input → Prefabs
(2)Drag & drop Input Manager
37
Check motion
Run
(1) Press [Shift] to use hand
(2) Left-click emulates AirTap
38
Create a script to receive AirTap
Right click on
blank of herarchy
Create Empty
Create an empty object to attach script
39
Create a script to receive AirTap
(1)GameObject
(2)Add Component
40
Create a script to receive AirTap
New Script
Scriot name
e.g.RcvAirTap
Create and Add
Added
41
Open script file by VisualStudio
Assets
Double click on
script (RcvAirTap)
42
Writing a script
using HoloToolkit.Unity.InputModule;
public class RcvAirTap : MonoBehaviour
{
// Start function is executed only once for initialization
void Start () {"R
obot Kyle");
}
// Update function is executed every frame
void Update () {
}
}
First, load InputModule and implement IInputClickHandler
, IInputClickHandler
43
Writing a script
public class RcvAirTap : MonoBehaviour , IInputClickHandler
{
// Start function is executed only once for initialization
void Start () {
}
// Update function to be executed every frame
void Update () {
}
}
•Move the cursor to llnputClickHandler,
Select lmplement interface from hint
44
Check the status quo
using HoloToolkit.Unity.InputModule;
public class RcvAirTap : MonoBehaviour , IInputClickHandler
{
//Called up function when AirTapped
public void OnInputClicked(InputEventData eventData)
{
throw new NotImplementedException();
}
void Start () {
}
void Update () {
}
}
throw new NotImplementedException();
Delete this line as unnecessary
45
What to do next
InputManager knows AirTap is done or not
Previous script is written here
Notify GameObject when InputManager recognizes AirTap
46
Receive AirTap
public class RcvAirTap : MonoBehaviour , IInputClickHandler
{
//Called up function when AirTapped
public void OnInputClicked(InputEventData eventData)
{
Debug.Log("AirTap!");
}
void Start () {
InputManager.Instance.
PushFallbackInputHandler(gameObject);
}
void Update () {
}
}
Register so that AirTap will
be notified to gameObject
with this script attached
47
Check motion
Run
AirTap! To be displayed
Console tab
48
Prefabrication of Edited Cube
(1) Assets
(2) Drag & drop Cube
49
What to do next
Cube prefab
Create a Cube (Prefab) in space for each AirTap
50
Generation of cube using script
public class RcvAirTap : MonoBehaviour , IInputClickHandler
{
//Variables to handle Cube prefab
public GameObject original;
public void OnInputClicked(InputEventData eventData)
{
// Instantiate cube using Cube prefab
GameObject cube = GameObject.Instantiate(original);
//Convert the position 1.2 m ahead from your
//viewpoint into the position in real space
cube.transform.position =
Camera.main.transform.TransformPoint(0, 0, 1.2f);
Debug.Log("AirTap!");
}
/*Omitted below*/
51
Assign Cube Prefab with variable of script
(1) Assets
(2) GameObject
Associate variable(=original) of script with Cube Prefab
Drag & drop Cub into Original
52
Check
Run
Generate cubes as many times as AirTapped
53
Limit the number of cubes
//container holding several cubes
List<GameObject> list = new List<GameObject>();
public void OnInputClicked(InputEventData eventData)
{
GameObject cube = GameObject.Instantiate(original);
cube.transform.position =
Camera.main.transform.TransformPoint(0, 0, 1.2f);
if (list.Count == 10)
{
Destroy(list[0]); //Delete the oldest cubes from space
list[0] = null;
list.RemoveAt(0); // Remove element in list 0
}
list.Add(cube);
}
54
Let's run on HoloLens: Confirm Quality
Edit
Project Settings
Quality
Fastest
55
Run on HoloLens: Build Setting
(1)Edit
(2)Project Settings
(3)Player
(4)Name ProductName
for yours
(5)Windows Store App
56
Run on HoloLens: Build Setting
Name Short
namefor yours
icon Other Settings
Virtual Reality
Supported
Publishing Settings
Name Package
Namefor yours
57
Run on HoloLens: Build Setting
File
Build Settings
58
Run on HoloLens: Build
Add OpenScenes
Windows Store
Switch Platform
・ SDK
Universal 10
・ Target device
HoloLens
・ UWP Build Type
D3D
Finally Build
59
Run on HoloLens: Create a folder for Build
Name App
New folder
Select folder
60
Project
yourname.sln
Appfolder
61
Run on a real machine: Deploy to HoloLens
x86
Click ▼
Remote
(In case of
Wifiapplication)
62
Run on a real machine: Deploy to HoloLens
In put HoloLens IP
Click Select
63
Run on a real machine: Deploy to HoloLens
Debug
Start Without
Debugging
64
Check motion
65
Hide the mesh
Spatial Mapping Smatial Mapping Manager
Click 〇
Select Spatial Mapping Occlusion for material
66
Increase the display range
HoloLens Camera
Change Nearto 0.3
Decreasing the value of the camera's Near, will work out
even in case of approaching to some extent
67
Import images pasted on Cube
[Assets]→
[Import New Asset]
→ Select the image you brought up
68
Material setting change
Click on the material (New Material) assigned to Cube
69
Material setting change
(1) Shader
(2) Unlit
(3) Texture
70
Paste texture
Drag and drop images
71
Completion
72
Any questions?
Please Contact Me!
Name:
Takashi Yoshinaga
Affiliation:
Institute of Systems, Information
Technologies and Nanotechnologies
Title:
(1) Researcher
(2) Microsoft MVP for Windows Development
taka.yoshinaga @tks_yoshinaga
YoshinagaTakashi
74
I’m also waiting for your suggestions on English expressions :)
HoloLens Programming Tutorial: AirTap & Spatial Mapping
HoloLens Programming Tutorial: AirTap & Spatial Mapping
HoloLens Programming Tutorial: AirTap & Spatial Mapping

More Related Content

What's hot (20)

PDF
Python 3.9からの新定番zoneinfoを使いこなそう
Ryuji Tsutsui
 
PDF
Awsでつくるapache kafkaといろんな悩み
Keigo Suda
 
PDF
マイクロサービスと Red Hat Integration
Kenta Kosugi
 
PPTX
GitLab CI/CD パイプライン
Tetsurou Yano
 
PDF
実践 WebRTC 〜最新事例と開発ノウハウの紹介〜
Yusuke Naka
 
PPTX
Ruby World Conference 2019 rubyによる超大量データ配信
Daisuke Yamazaki
 
PPTX
JJUG CCC 2017 Fall オレオレJVM言語を作ってみる
Koichi Sakata
 
PPTX
Redis勉強会資料(2015/06 update)
Yuji Otani
 
PDF
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
Unity Technologies Japan K.K.
 
PDF
FreeRTOS 概要+アップデート
Amazon Web Services Japan
 
PDF
Gangliaはじめました
yuzorock
 
PDF
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
Unity Technologies Japan K.K.
 
PPTX
【続】OpenXRでHoloLensアプリを作る
Takahiro Miyaura
 
PPTX
World Locking Tools V1.0.0について~ 機能と導入 ~
Takahiro Miyaura
 
PDF
ソフトウェア設計のすすめ
Yoshimura Soichiro
 
PDF
グラフデータの視覚化ツールーTom Sawyer Perspectives
昌桓 李
 
PDF
REST API のコツ
pospome
 
PDF
【Unite 2017 Tokyo】「黒騎士と白の魔王」にみるC#で統一したサーバー/クライアント開発と現実的なUniRx使いこなし術
Unity Technologies Japan K.K.
 
PDF
【CEDEC2013】20対20リアルタイム通信対戦オンラインゲームのサーバ開発&運営技法
モノビット エンジン
 
PDF
Ansibleで始めるインフラ構築自動化
dcubeio
 
Python 3.9からの新定番zoneinfoを使いこなそう
Ryuji Tsutsui
 
Awsでつくるapache kafkaといろんな悩み
Keigo Suda
 
マイクロサービスと Red Hat Integration
Kenta Kosugi
 
GitLab CI/CD パイプライン
Tetsurou Yano
 
実践 WebRTC 〜最新事例と開発ノウハウの紹介〜
Yusuke Naka
 
Ruby World Conference 2019 rubyによる超大量データ配信
Daisuke Yamazaki
 
JJUG CCC 2017 Fall オレオレJVM言語を作ってみる
Koichi Sakata
 
Redis勉強会資料(2015/06 update)
Yuji Otani
 
【Unite Tokyo 2018】さては非同期だなオメー!async/await完全に理解しよう
Unity Technologies Japan K.K.
 
FreeRTOS 概要+アップデート
Amazon Web Services Japan
 
Gangliaはじめました
yuzorock
 
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
Unity Technologies Japan K.K.
 
【続】OpenXRでHoloLensアプリを作る
Takahiro Miyaura
 
World Locking Tools V1.0.0について~ 機能と導入 ~
Takahiro Miyaura
 
ソフトウェア設計のすすめ
Yoshimura Soichiro
 
グラフデータの視覚化ツールーTom Sawyer Perspectives
昌桓 李
 
REST API のコツ
pospome
 
【Unite 2017 Tokyo】「黒騎士と白の魔王」にみるC#で統一したサーバー/クライアント開発と現実的なUniRx使いこなし術
Unity Technologies Japan K.K.
 
【CEDEC2013】20対20リアルタイム通信対戦オンラインゲームのサーバ開発&運営技法
モノビット エンジン
 
Ansibleで始めるインフラ構築自動化
dcubeio
 

Similar to HoloLens Programming Tutorial: AirTap & Spatial Mapping (20)

PPTX
Code europe holobasics - develop your mixed reality hololens app with unity...
Alexander Meijers
 
PPTX
It next summit - holobasics - develop your mixed reality hololens app with un...
Alexander Meijers
 
PPTX
How to make your first HoloLens App?
Shingo Mori
 
PDF
Introduction to development
Matteo Valoriani
 
PPTX
Code europe holoadvanced - building more advanced mixed reality apps for ho...
Alexander Meijers
 
PPTX
November.2015.RealityBasedUI
Reuben Ahmed
 
PDF
Developing VR Experiences with Unity
Mark Billinghurst
 
PPTX
Holo basics develop your mixed reality hololens app with unity and visual s...
Alexander Meijers
 
PDF
Maze VR
Daosheng Mu
 
PDF
Unity 101
Hibby Games
 
PPTX
2017 03 22 Lessons learned building Hololens 3D apps from a 2D app developer
Bruno Capuano
 
PPTX
2017 06 Ontario Hololens Tour
Bruno Capuano
 
PDF
Cardboard VR: Building Low Cost VR Experiences
Mark Billinghurst
 
PDF
1604.08848v1
Markus Höll
 
PPTX
Augmented Reality - Let’s Make Some Holograms! (UXD Version)
Cameron Vetter
 
PPTX
Achmea technight - HoloLens development
Alexander Meijers
 
PDF
Brisbane GameTech - Kicking off Development & Object Recognition with HoloLens
Stephen Carter
 
PPTX
Augmented Reality - Let’s Make Some Holgrams! (Developer Version)
Cameron Vetter
 
PDF
Useful Tools for Making Video Games - XNA (2008)
Korhan Bircan
 
PDF
Developing Interactive 3D Experiences in HTML5 with Carlos Ulloa
FITC
 
Code europe holobasics - develop your mixed reality hololens app with unity...
Alexander Meijers
 
It next summit - holobasics - develop your mixed reality hololens app with un...
Alexander Meijers
 
How to make your first HoloLens App?
Shingo Mori
 
Introduction to development
Matteo Valoriani
 
Code europe holoadvanced - building more advanced mixed reality apps for ho...
Alexander Meijers
 
November.2015.RealityBasedUI
Reuben Ahmed
 
Developing VR Experiences with Unity
Mark Billinghurst
 
Holo basics develop your mixed reality hololens app with unity and visual s...
Alexander Meijers
 
Maze VR
Daosheng Mu
 
Unity 101
Hibby Games
 
2017 03 22 Lessons learned building Hololens 3D apps from a 2D app developer
Bruno Capuano
 
2017 06 Ontario Hololens Tour
Bruno Capuano
 
Cardboard VR: Building Low Cost VR Experiences
Mark Billinghurst
 
1604.08848v1
Markus Höll
 
Augmented Reality - Let’s Make Some Holograms! (UXD Version)
Cameron Vetter
 
Achmea technight - HoloLens development
Alexander Meijers
 
Brisbane GameTech - Kicking off Development & Object Recognition with HoloLens
Stephen Carter
 
Augmented Reality - Let’s Make Some Holgrams! (Developer Version)
Cameron Vetter
 
Useful Tools for Making Video Games - XNA (2008)
Korhan Bircan
 
Developing Interactive 3D Experiences in HTML5 with Carlos Ulloa
FITC
 
Ad

More from Takashi Yoshinaga (20)

PPTX
HoloLens2とMeta QuestではじめるWebXR
Takashi Yoshinaga
 
PPTX
【準備編】OculusQuest/HoloLens2対応WebXR開発
Takashi Yoshinaga
 
PPTX
ARコンテンツ作成勉強会( #AR_Fukuoka )紹介
Takashi Yoshinaga
 
PPTX
AI x WebAR: MediaPipeのハンドトラッキングを使ってみよう
Takashi Yoshinaga
 
PPTX
iPad LiDARで エンジニアカフェを3Dスキャン
Takashi Yoshinaga
 
PPTX
AI x OpenCV x WebAR: Selfie Segmentationを使ってみよう
Takashi Yoshinaga
 
PPTX
Web技術ではじめようAR/VRアプリ開発
Takashi Yoshinaga
 
PPTX
MRTKをNreal Lightに対応させてみた
Takashi Yoshinaga
 
PPTX
Nreal Lightハンズオン
Takashi Yoshinaga
 
PPTX
【準備編!】HoloLens 2/Oculus Quest対応WebXRハンズオン
Takashi Yoshinaga
 
PPTX
A-Frameで始めるWebXRとハンドトラッキング (HoloLens2/Oculus Quest対応)
Takashi Yoshinaga
 
PPTX
Holo-SDKハンズオン:はじめようヘッドトラッキングを用いた3D表現
Takashi Yoshinaga
 
PPTX
FUKUOKA Engineers Day 2021 発表資料:AR Fukuoka & HoloBox紹介
Takashi Yoshinaga
 
PPTX
Voxon Photonics VX1 で遊んでみた
Takashi Yoshinaga
 
PPTX
AR-Frame x AR.js入門
Takashi Yoshinaga
 
PPTX
AI x WebXR: フェイストラッキングを用いた擬似3D表現を解説!
Takashi Yoshinaga
 
PPTX
コロナ禍中のコミュニティ活動
Takashi Yoshinaga
 
PPTX
Project HoloBox
Takashi Yoshinaga
 
PPTX
AR Fukuoka紹介2020
Takashi Yoshinaga
 
PPTX
iPad LiDARで作ってみた in AR Fukuoka 忘年会2020
Takashi Yoshinaga
 
HoloLens2とMeta QuestではじめるWebXR
Takashi Yoshinaga
 
【準備編】OculusQuest/HoloLens2対応WebXR開発
Takashi Yoshinaga
 
ARコンテンツ作成勉強会( #AR_Fukuoka )紹介
Takashi Yoshinaga
 
AI x WebAR: MediaPipeのハンドトラッキングを使ってみよう
Takashi Yoshinaga
 
iPad LiDARで エンジニアカフェを3Dスキャン
Takashi Yoshinaga
 
AI x OpenCV x WebAR: Selfie Segmentationを使ってみよう
Takashi Yoshinaga
 
Web技術ではじめようAR/VRアプリ開発
Takashi Yoshinaga
 
MRTKをNreal Lightに対応させてみた
Takashi Yoshinaga
 
Nreal Lightハンズオン
Takashi Yoshinaga
 
【準備編!】HoloLens 2/Oculus Quest対応WebXRハンズオン
Takashi Yoshinaga
 
A-Frameで始めるWebXRとハンドトラッキング (HoloLens2/Oculus Quest対応)
Takashi Yoshinaga
 
Holo-SDKハンズオン:はじめようヘッドトラッキングを用いた3D表現
Takashi Yoshinaga
 
FUKUOKA Engineers Day 2021 発表資料:AR Fukuoka & HoloBox紹介
Takashi Yoshinaga
 
Voxon Photonics VX1 で遊んでみた
Takashi Yoshinaga
 
AR-Frame x AR.js入門
Takashi Yoshinaga
 
AI x WebXR: フェイストラッキングを用いた擬似3D表現を解説!
Takashi Yoshinaga
 
コロナ禍中のコミュニティ活動
Takashi Yoshinaga
 
Project HoloBox
Takashi Yoshinaga
 
AR Fukuoka紹介2020
Takashi Yoshinaga
 
iPad LiDARで作ってみた in AR Fukuoka 忘年会2020
Takashi Yoshinaga
 
Ad

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 

HoloLens Programming Tutorial: AirTap & Spatial Mapping

  • 1. AirTap & Spatial Mapping HoloLens Programming Tutorial:
  • 2. Development Tools Development environment:Unity  Game engine and development environment for multi-platform  You can visually place CGs and add functions by using GUI  Interactive behavior can be described in C# or javascript  HoloLens is supported from Unity 5.5 Development support tool::HoloToolkit  Toolkit to support the development of HoloLens compatible systems  You can use AirTap and cursor behavior, spatial mapping easily  Various sample programs are provided  Also provides functions such as moving viewpoint on Unity editor It is possible to develop without HoloLens or emulator 2
  • 3. Goal of this tutorial YouTube → https://youtu.be/_BmbL4yw8R0 3
  • 4. First of all, the basic operation of Unity 4
  • 5. Create a project (1) Extract HoloToolkit-Unity-master.zip to any directory (2) After starting Unity, click OPEN at the upper right of the screen OPEN 5
  • 6. Create a project Open HoloToolkit-Unity-masterfolder and click [folder selection] HoloToolkit-Unity-master Select folder HoloToolkit-Unity-master 6
  • 7. Unity operation screen (overview) Game space design area Name list of objects placed in space List of Asset (CG, program, etc.) added to the project 7
  • 8. Let's add CG to the game space Right click 3D Object→Cube 8
  • 9. Let's run Click and run Click to Exit Space seen from a camera 9
  • 10. Adjust the position, orientation and size of the object Click and select move rotate zoom in / out 10
  • 11. Let's change the perspective of Scene [←][→] -Move left and right [↑] [↓] -Zoom in/out [Alt] + drag -Rotation Other thingshttp://goo.gl/Lq1ILT → http://goo.gl/Lq1ILT 11
  • 12. Designation of CG position/ size using numerical values Click Change Position to 0 0 1.2 Change all scale to 0.15 ※ The unit of position and size is meter Inspector(≒Detailed Information 12
  • 13. Editing CG detailed information :color setting (1/3) ②Right click ③ Create Make detailed material to set colour and texture ④ Material ①Assets 13
  • 14. Editing CG detailed information: color setting (2/3) Edit colour (Albedo) of the created material (2) Click on the white area next to Albedo and select a color (1) Select created material 14
  • 15. Editing CG detailed information: colour setting (3/3) Open the material of the Cube to assign the created material (2) Top of Materials▼ (1)Cube (3) Drag and drop to Element 0 review 15
  • 16. Check It is OK if the colour is reflected. You can change the colour later. 16
  • 17. Setting the influence of gravity Add Component 選択 RigidBody 17
  • 18. Operation check and fine adjustment Let's run it When Cube looks smaller, change Position of MainCame to 0, 0, 0 18
  • 19. Creation of ground Click right 3D Object→Plane 19
  • 20. Adjust the ground position Plane Change Position to 0 -0.8 0 20
  • 21. Save Scene Scene Name  Open the dialog with [Ctrl] + [s] and save with your favourite name  Frequently save during content creation 21
  • 24. Adding HoloLens Camera (1) Assets → HoloToolkit → Input → Prefabs (2)Drag & Drop HoloLens Camera 24
  • 25. Check Light & Left by[←] [→] Forward & Backword by[↑] [↓] Up & down by[Q] [E] Rotation by right click + mouse move 25
  • 26. Supplement: Adjust movement / rotation sensitivity (1) Select operation content KeyboardXZTranslation (2) Sensitivity Scale to 2 (3) Axis Type to Keyboard Arrows Amount of movement when pushing keys :↑↓← → , will become less than the default 26
  • 27. Spatial recognition using SpatialMapping Remove Plane 27
  • 28. Spatial recognition using SpatialMapping Assets → HoloToolkit → SpatialMapping → Prefabs Drag & drop SpatialMapping 28
  • 29. Operation Space is recognized by actual HoloLens, but not by PC 29
  • 30. Importing a space model (official sample) ② Assets → HoloToolkit → SpatialMapping → Tests → Meshes ③ Drag & drop SRMesh into Room Model ① Spatial Mapping 30
  • 31. Importing a space model (official sample) (1)Run The model of the room is displayed More simplified one provided instead of more complexed one 31
  • 32. A room for use 32
  • 33. Import of space model (for study group) Assets → Import New Asset → isit.obj Import spatial model (isit.obj) prepared as sample 33
  • 34. Import of space model (2)SpatialMapping (3) Drag & drop into Room Model (1)Assets 34
  • 35. Change appearance of mesh Click button next to Surface Material SpatialMappingWireframe Before After 35
  • 36. Create and drop Cube at the same time as AirTap What to do next 36
  • 37. Add function to manage input operations such as AirTap (1)HoloToolkit → Input → Prefabs (2)Drag & drop Input Manager 37
  • 38. Check motion Run (1) Press [Shift] to use hand (2) Left-click emulates AirTap 38
  • 39. Create a script to receive AirTap Right click on blank of herarchy Create Empty Create an empty object to attach script 39
  • 40. Create a script to receive AirTap (1)GameObject (2)Add Component 40
  • 41. Create a script to receive AirTap New Script Scriot name e.g.RcvAirTap Create and Add Added 41
  • 42. Open script file by VisualStudio Assets Double click on script (RcvAirTap) 42
  • 43. Writing a script using HoloToolkit.Unity.InputModule; public class RcvAirTap : MonoBehaviour { // Start function is executed only once for initialization void Start () {"R obot Kyle"); } // Update function is executed every frame void Update () { } } First, load InputModule and implement IInputClickHandler , IInputClickHandler 43
  • 44. Writing a script public class RcvAirTap : MonoBehaviour , IInputClickHandler { // Start function is executed only once for initialization void Start () { } // Update function to be executed every frame void Update () { } } •Move the cursor to llnputClickHandler, Select lmplement interface from hint 44
  • 45. Check the status quo using HoloToolkit.Unity.InputModule; public class RcvAirTap : MonoBehaviour , IInputClickHandler { //Called up function when AirTapped public void OnInputClicked(InputEventData eventData) { throw new NotImplementedException(); } void Start () { } void Update () { } } throw new NotImplementedException(); Delete this line as unnecessary 45
  • 46. What to do next InputManager knows AirTap is done or not Previous script is written here Notify GameObject when InputManager recognizes AirTap 46
  • 47. Receive AirTap public class RcvAirTap : MonoBehaviour , IInputClickHandler { //Called up function when AirTapped public void OnInputClicked(InputEventData eventData) { Debug.Log("AirTap!"); } void Start () { InputManager.Instance. PushFallbackInputHandler(gameObject); } void Update () { } } Register so that AirTap will be notified to gameObject with this script attached 47
  • 48. Check motion Run AirTap! To be displayed Console tab 48
  • 49. Prefabrication of Edited Cube (1) Assets (2) Drag & drop Cube 49
  • 50. What to do next Cube prefab Create a Cube (Prefab) in space for each AirTap 50
  • 51. Generation of cube using script public class RcvAirTap : MonoBehaviour , IInputClickHandler { //Variables to handle Cube prefab public GameObject original; public void OnInputClicked(InputEventData eventData) { // Instantiate cube using Cube prefab GameObject cube = GameObject.Instantiate(original); //Convert the position 1.2 m ahead from your //viewpoint into the position in real space cube.transform.position = Camera.main.transform.TransformPoint(0, 0, 1.2f); Debug.Log("AirTap!"); } /*Omitted below*/ 51
  • 52. Assign Cube Prefab with variable of script (1) Assets (2) GameObject Associate variable(=original) of script with Cube Prefab Drag & drop Cub into Original 52
  • 53. Check Run Generate cubes as many times as AirTapped 53
  • 54. Limit the number of cubes //container holding several cubes List<GameObject> list = new List<GameObject>(); public void OnInputClicked(InputEventData eventData) { GameObject cube = GameObject.Instantiate(original); cube.transform.position = Camera.main.transform.TransformPoint(0, 0, 1.2f); if (list.Count == 10) { Destroy(list[0]); //Delete the oldest cubes from space list[0] = null; list.RemoveAt(0); // Remove element in list 0 } list.Add(cube); } 54
  • 55. Let's run on HoloLens: Confirm Quality Edit Project Settings Quality Fastest 55
  • 56. Run on HoloLens: Build Setting (1)Edit (2)Project Settings (3)Player (4)Name ProductName for yours (5)Windows Store App 56
  • 57. Run on HoloLens: Build Setting Name Short namefor yours icon Other Settings Virtual Reality Supported Publishing Settings Name Package Namefor yours 57
  • 58. Run on HoloLens: Build Setting File Build Settings 58
  • 59. Run on HoloLens: Build Add OpenScenes Windows Store Switch Platform ・ SDK Universal 10 ・ Target device HoloLens ・ UWP Build Type D3D Finally Build 59
  • 60. Run on HoloLens: Create a folder for Build Name App New folder Select folder 60
  • 62. Run on a real machine: Deploy to HoloLens x86 Click ▼ Remote (In case of Wifiapplication) 62
  • 63. Run on a real machine: Deploy to HoloLens In put HoloLens IP Click Select 63
  • 64. Run on a real machine: Deploy to HoloLens Debug Start Without Debugging 64
  • 66. Hide the mesh Spatial Mapping Smatial Mapping Manager Click 〇 Select Spatial Mapping Occlusion for material 66
  • 67. Increase the display range HoloLens Camera Change Nearto 0.3 Decreasing the value of the camera's Near, will work out even in case of approaching to some extent 67
  • 68. Import images pasted on Cube [Assets]→ [Import New Asset] → Select the image you brought up 68
  • 69. Material setting change Click on the material (New Material) assigned to Cube 69
  • 70. Material setting change (1) Shader (2) Unlit (3) Texture 70
  • 71. Paste texture Drag and drop images 71
  • 73. Any questions? Please Contact Me! Name: Takashi Yoshinaga Affiliation: Institute of Systems, Information Technologies and Nanotechnologies Title: (1) Researcher (2) Microsoft MVP for Windows Development taka.yoshinaga @tks_yoshinaga YoshinagaTakashi
  • 74. 74 I’m also waiting for your suggestions on English expressions :)