Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Getting Started With MRTK (for Beginner)
Search
TakashiYoshinaga
June 20, 2020
Technology
750
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting Started With MRTK (for Beginner)
TakashiYoshinaga
June 20, 2020
More Decks by TakashiYoshinaga
See All by TakashiYoshinaga
Nreal Light / Air 開発入門ハンズオン
takashiyoshinaga
0
1.1k
MediaPipeのハンドトラッキングで作るARライトセイバー
takashiyoshinaga
1
390
UnityとZapWorksで始めようWebAR開発
takashiyoshinaga
0
4.2k
Getting Started with WebAR for HoloLens2 and Meta Quest
takashiyoshinaga
0
2.9k
Getting Started with HoloSDK
takashiyoshinaga
0
320
Getting Started with Non-Programming AR Development with MRTK v2.4.0
takashiyoshinaga
0
2.9k
始めようWebAR/VR開発
takashiyoshinaga
1
1.1k
Getting Started with Azure Kinect DK
takashiyoshinaga
1
6.2k
Getting Started with WebVR Contents Creation for Oculus Quest
takashiyoshinaga
2
660
Other Decks in Technology
See All in Technology
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
390
失敗を資産に変えるClaude Code
shinyasaita
0
700
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
1.2k
Kiroで書いた 設計書 が AI レビューの 採点基準 になる
ezaki
0
120
攻撃者視点で考えるDetection Engineering
cryptopeg
3
1.9k
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
410
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
1.2k
20260619 私の日常業務での生成 AI 活用
masaruogura
1
220
200個のGitHubリポジトリを横断調査したかった
icck
0
130
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
130
作って終わりにしない タイミーのセマンティックレイヤー育成の現在地
chanyou0311
4
2.5k
[AWS Summit Japan 2026]迷っているあなたへ_小さな一歩が、やがて自分を助けてくれる
sh_fk2
1
110
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Producing Creativity
orderedlist
PRO
348
40k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
630
Accessibility Awareness
sabderemane
1
140
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
330
Agile that works and the tools we love
rasmusluckow
331
21k
Leo the Paperboy
mayatellez
7
1.8k
Rails Girls Zürich Keynote
gr2m
96
14k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
Transcript
Getting Started With MRTK for Beginner
#AR_Fukuoka Hashtag
Goal Learn about object manipulation as the basic usage of
MRTK https://youtu.be/qUQXZACp35A
Sample Data http://arfukuoka.lolipop.jp/mrtk/Sample.zip
Downloading MRTK (1/3) https://github.com/Microsoft/MixedRealityToolkit-Unity releases
Downloading MRTK (2/3) Microsoft Mixed Reality Toolkit v2.4.0 is used
for this tutorial 少し下にスクロール
Downloading MRTK (3/3) Download Foundation.2.4.0.unitypackage Foundation.2.4.0.unitypackage
Creating Project (1/6) Launch UnityHub and click Project Project
Creating Project (2/6) Click ▽ aligned on the right side
of NEW button. ▽
Creating Project (3/6) Select 2018.4.xxf1 (2018.4.23f1 is selected in this
deck) 2018.4.xxf1
Creating Project (4/6) ①3D ②Set the project name (ex.ARFukuoka_MRTK) ③Select
the directory to save the project
Creating Project (5/6) Create
Creating Project (6/6) Unity Editor will appear
Installation of MRTK (1/3) Double click the unitypackage. Click Import
button of Import Unity Package dialog. Microsoft.MixedReality. Toolkit.Unity.Foundation .2.4.0.unitypackage Import
Installation of MRTK (2/3) Apply Click Apply button to switch
the setting to xR.
Installation of MRTK (3/3) Close Close MRTK Project Configurator dialog.
Adding 3D Object into the Space (1/3) Right click blank
of Hierarchy
Adding 3D Object into the Space (2/3) ①3D Object ②Cube
Adding 3D Object into the Space (3/3) Cube should appear
Run View from camera will be shown. Click to play
Click it again to stop preview
Modification of Objectʼs Transform Click Cube
Modification of Objectʼs Transform Move Rotate Scale
Inputting Values to Transform Object Click Cube
Inputting Values to Transform Object p Properties of each object
can be added/edited in Inspector p Position/Rotation/Scale are editable in Transform. Inspector
Inputting Values to Transform Object Set as following Positionを 0
0 1 Rotation 0 0 0 Scale 0.3 0.3 0.3 p Properties of each object can be added/edited in Inspector p Position/Rotation/Scale are editable in Transform.
Controlling Viewpoint of Scene Letʼs set the object at the
center of scene tab
Controlling Viewpoint of Scene Double Click Cube
Controlling Viewpoint of Scene Object can be shown on the
center of Scene tab.
Controlling Viewpoint of Scene [←] [→]: Move to Left/RIght [↑][↓]:
Zoom In/Out [Alt]+Drag: Rotation +Drag: Move to ←→↑↓
Next Step Not only Transform but also appearance and behavior
and properties can be edited in Inspector
Changing Color of Cube (1/4) ① Cube ② See Mesh
Renderer ③ Open Materials
Changing Color of Cube (2/4) Element0
Changing Color of Cube (3/4) Appearance information is described in
Material file
Changing Color of Cube (4/4) Detail of Material is shown
at the bottom of Inspector. But Default-Material is not editable.
Itʼs necessary to create Material file to edit appearance of
a object.
Creating Material (1/3) Create Material to describe color of Cube.
①Assets ②Right Click
Creating Material (2/3) Create Material to describe color of Cube.
①Create ②Material
Creating Material (3/3) New Material should appear Create Material to
describe color of Cube.
Application of Material (1/2) Open Materials of Cube in Inspector
② See Default-Material ①Cube
Application of Material (2/2) Replace Default-Material with New Material. Drag
& Drop into Default-Material
Editing Color of Cube (1/3) ①Cube ②Material should be New
Material
Editing Color of Cube (2/3) Open NewMaterial Click □ next
to Albedo
Editing Color of Cube (3/3) Color should be changed
How to Save this Scene (1/4) File
How to Save this Scene (2/4) SaveAs...
How to Save this Scene (3/4) ①Name as Sample1 ②Save
How to Save this Scene (4/4) Sample1 should be appear
in Assets
You can override the scene with current info by Ctrl
/ Command + S
Letʼs use MRTK from now!
What Youʼll Do at First? Prepare moving around and using
hand in UnityEditor
Using Camera of MRTK (1/3) MixedRealityToolkit
Using Camera of MRTK (2/3) Add to Scene and Configure...
Using Camera of MRTK (3/3) MixedRealityToolKit and MixedRealityPlayspace should appear
Play (1/4) Click Play
Play (2/4) [A][D] :Move to Left and Right [W][S] :Zoom
In/Out [Q][E] :Move to Up and Down RightClick + Drag :Rotation
Play (3/4) [Shift] :Show left hand [Space] :Show right hand
While hand is appearing+ [Click] :Pinch [Scroll] :Forward/Back
Play (4/4) Stop before going to next step
Letʼs manipulate Cube
Making Cube Manipulatable (1/3) ①Cube ②Add Component
Making Cube Manipulatable (2/3) Search [manipulation] Select ManipulationHandler
Making Cube Manipulatable (3/3) ①Cube ②ManipulationHandler should be added
Enable Near Interaction ①Cube ②Add Component
Enable Near Interaction ①Search [Near] ②NearInteractionGrabbable
Enable Near Interaction ①Cube ②NearInteractionGrabbable should be added
Play (1/4) Click Play
One Hand Manipulation
Play (2/4) Shift or Space
Play (3/4) Put the cursor on Cube
Play (4/4) Drag and move Cube
Two Hand Manipulation
Play (1/5) Show left hand by pushing Shift
Play (2/5) ①Click after putting cursor on Cube ② Hit
[T] to fix left hand
Play (3/5) Show right hand by pushing Space
Play (4/5) Drag and move
Play (5/5) You can Rotate/Scale Cube
Letʼs Add Another Object
Adding Obj File(1/7) Assets
Adding Obj File (2/7) Sample Folder → Model
Adding Obj File (3/7) Drag & Drop Model into Assets
Adding Obj File (4/7) Model
Adding Obj File (5/7) model.obj
Adding Obj File (6/7) Drag & Drop model.obj into Hierarchy
Adding Obj File (7/7) ①model Set chair as following nbv
Position 0.5 -0.3 1 Rotation 0 180 0
In order to enable chair to detect contact with hand,
Collider should be added to model.obj
Adding Collider (1/5) ①model ②Add Component
Adding Collider (2/5) ①Search box ②BoxCollider
Adding Collider (3/5) Bounding box will appear
Adding Collider (4/5) ①model ②Edit Collider
Adding Collider (5/5) Adjust position of each face by moving▪
Make Chair Manipulatable (1/5) ①model ②Add Component
Make Chair Manipulatable (2/5) ① Searchmanipulation ②ManipulationHandler
Make Chair Manipulatable (3/5) ①model ②Add Component
Make Chair Manipulatable (4/5) ①Search near ②NearInteractionGrabbable
Make Chair Manipulatable (5/5) ①model ②NearInteractionGrabbable should be appear
Restrict the Direction of the Chair ①model ②Set One Hand
Rotation Mode Near/Far to Gravity Aligned Maintain Rotation to User
Allow Only Rotation for 2 Hand Operation ①model ②Set Rotate
for Two Hand Manipulation Type ③ Set Y Axis Only for Constraint On Rotation
Play Put cursor on chair Drag to move Rotate with
to hands
Play Stop
Remove Performance Viewer Can be deleted
Remove Performance Viewer ①MixedRealityToolKit ②Copy & Customize
Remove Performance Viewer ①Change Profile Name to Sample1 MixedRealityToolkit... ②Clone
Remove Performance Viewer ①Diagnostics ②Turn Enable Diagnostics System into Off
Play
Play Stop
p HoloLens2 p ARFoundation(ARKit/ARCore) Running On AR Devices
p HoloLens2 p ARFoundation(ARKit/ARCore) Running On AR Devices
Build Setting for HoloLens2 File
Build Setting for HoloLens2 Build Setting
Build Setting for HoloLens2 ①Universal Windows Platform ②Switch Platform
Build Setting for HoloLens2 Apply
Build Setting for HoloLens2 Player Settings...
Build Setting for HoloLens2 ①XR Settings ②Select 16-bit depth ad
Depth Format
Build for HoloLens2 Build
Build for HoloLens2 New Folder
Build for HoloLens2 Rename new folder to build
Build for HoloLens2 ①build ②Select Folder
Wait for a moment...
Build for HoloLens2 Open build
Build for HoloLens2 Open solution (*.sln) with VisualStudio2019
Build for HoloLens2 Release ARM
Build for HoloLens2 ▼
Build for HoloLens2 Device
Connect HoloLens2 and PC by using USB cable
Build for HoloLens2 ① Debug ②Start without debug
None
p HoloLens2 p ARFoundation(ARKit/ARCore) Running On AR Devices
p HoloLens2 p ARFoundation(ARKit/ARCore) Running On AR Devices
Instalation of ARFoundation Window
Instalation of ARFoundation Package Manager
Instalation of ARFoundation ①AR Foundation ②Open version list
Instalation of ARFoundation ①All Version ②1.5.0-preview.6
Instalation of ARFoundation Install
Setting procedure for iOS is from next page.
Installation of ARKit (for iOS) ①ARKit XR Plugin ②2.1.2
Installation of ARKit (for iOS) Install
Setting procedure for Android is from next page.
Installation of ARCore (for Android) ①ARCore XR Plugin ②2.1.2
Installation of ARCore (for Android) Install
Setting procedure for both ARCore/ARKi is from here.
Build Setting for ARFoundation ①MixedRealityToolkit ②DefaultHoloLens2Configuration
Build Setting for ARFoundation Copy & Customize
Build Setting for ARFoundation ①Set ProfileName as Mobile MixedRealityToolkit... ②Clone
Build Setting for ARFoundation ①Camera ②Clone
Build Setting for ARFoundation ①Set ProfileName as Mobile MixedRealityCameraProfile ②Clone
Build Setting for ARFoundation Camera Setting Providers
Build Setting for ARFoundation -
Build Setting for ARFoundation AddCameraSettingsProvider
Build Setting for ARFoundation Newdataprovider 0
Build Setting for ARFoundation Open Taypeを開く
Build Setting for ARFoundation ①MicrosoftMixedReality.Toolkit.Experimental.UnityAR ②UnityARCameraSetting
Remofe Performance Viewer Diagnostics
Remofe Performance Viewer Turn Off Enable Diagnostics System
Build for ARFoundation File
Build for ARFoundation Build Settings...
Build for ARKit(iOS) ①iOS ②Switch Platform
Build for ARCore(Android) ①Android ②Switch Platform
Build for ARFoundation Apply
Build for ARFoundation Player Settings...
Setting procedure for iOS is from next page.
Build for ARKit(iOS) Other Settings
Build for ARKit(iOS) Set Bundle Identifier ex) com.Yoshinaga.ARFukuoka
Build for ARKit(iOS) Strip Engine CodeをOff
Setting procedure for Android is from next page.
Build for ARCore(Android) Set Package Name ex)com.yourname.arfukuoka
Build and Run for ARCore/ARKit
動作の様⼦
Ctrl / Command + S Save
Letʼs Use Spatial Awareness Next Step is...
Use room mesh model
Duplicate Current Scene File
Duplicate Current Scene Save As...
Duplicate Current Scene Save As...
Import of Spatial Mesh Model Assets
Import of Spatial Mesh Model Import New Asset
Import of Spatial Mesh Model ①room.obj ②import
Import of Spatial Mesh Model room should appear
Import of Spatial Mesh Model MixedRealityToolkit Clone
Import of Spatial Mesh Model ①Set ProfileName as Sample2 MixedRealityToolkit...
②Clone
Visualization of Spatial Mesh Model ①MixedRealityToolkit ②Spatial Awareness
Visualization of Spatial Mesh Model Clone
Visualization of Spatial Mesh Model ①Set ProfileName as Sample2MixedRealityCameraProfile ②Clone
Visualization of Spatial Mesh Model Windows Mixed Reality Spatial Mesh
Observer
Visualization of Spatial Mesh Model Typeを開く
Visualization of Spatial Mesh Model ①Microsoft.MixedReality.Toolkit.SpatialObjectMeshObserver ②SpatialObjectMeshObserver
Visualization of Spatial Mesh Model Clone
Visualization of Spatial Mesh Model ①Set ProfileName as Sample2SpatialObjectMeshObserver... ②Clone
Visualization of Spatial Mesh Model See Spatial Mesh Object
Visualization of Spatial Mesh Model See room (Do NOT click)
Visualization of Spatial Mesh Model Drag&Drop into ExampleSpatialMesh
Visualization of Spatial Mesh Model Replaced to room
Replace Material of Spatial Mesh Click ◦ aligned on the
right of MRTK_ Wireframe
Replace Material of Spatial Mesh Defaultで検索 Defaultを選択 ※他のMtaterialでもOK
Replace Material of Spatial Mesh Example Spatial Mesh Default Material
Using Gravity ①model ②Add Component
Using Gravity ①Search rigid ②Rigidbody
Using Gravity ①model ②Rigidbody ③Turn ON Use Gravity
Run
Depending on the development environment, the chair may fall off
before the mesh appears on the scene. Keep the chair in the air at first and allow it to fall when you let go of your hand.
Turn Off Gravity ①model ② See Rigidbody
Turn Off Gravity ①Use GravityをOff ②Is KinematicをOn Note︓ Turn Is
Kinematic On to prevent physical interference. Prevents the chair from hitting the mesh and flying away when the app is launched.
Turn On Gravity After Manipulation model The ManipulationHandler has OnManipulation
Started/Ended, which makes it easy to get the operation started and finished.
Turn On Gravity After Manipulation ①model ②Add Component
Turn On Gravity After Manipulation ①Clear Search Area ③Set Script
Name ex)PhysicsScript ②New script ④Create and Add
Letʼs Write Script ①model ②Physics Script should appear.
Letʼs Write Script ①model ②Open Physics Script
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhysicsScript :
MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } } Editing Script
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhysicsScript :
MonoBehaviour { Delete Start and Update function } Editing Script
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhysicsScript :
MonoBehaviour { //SetGravityにtrue/falseを渡すことで重⼒および物理⼲渉のOn/Offを切り替える public void SetGravity(bool flag) { //重⼒のOn/Offを設定 gameObject.GetComponent<Rigidbody>().useGravity = flag; //物理的な⼲渉のOn/Offを設定 gameObject.GetComponent<Rigidbody>().isKinematic = !flag; } } Function to Switch On/Off Physics
Turn On Gravity when Manipulation is Ended ①model ②On Manipulation
Ended ③Click +
Turn On Gravity when Manipulation is Ended ①model Drag &
Drop into area of shown as None
Turn On Gravity when Manipulation is Ended ①model ②Click No
Function
Turn On Gravity when Manipulation is Ended ②SetGravity(bool) ①PhysicsScript
Turn On Gravity when Manipulation is Ended ①model ③Turn On
②See Manipulation Ended
Setting Hand Gesture ①model
Setting Hand Gesture ①SetManipulation Type as One Handed Only ②Set
Constraint on Rotation as None
The object (chair) will rebound and roll when spatial meshes
are refreshed on the actual HoloLens. Turn off gravity as soon as collision with spatial mesh
using System.Collections; using System.Collections.Generic; using UnityEngine; public class HandScript :
MonoBehaviour { //SetGravityにtrue/falseを渡すことで重⼒および物理⼲渉のOn/Offを切り替える public void SetGravity(bool flag) { gameObject.GetComponent<Rigidbody>().useGravity = flag; gameObject.GetComponent<Rigidbody>().isKinematic = !flag; } //Called when collision is occured private void OnCollisionEnter(Collision collision) { SetGravity(false); } }
Delete Unused Object Remove Cube
Delete Unused Object
Play on Unity Editor
Letʼs build and deploy this application into xR device.
p HoloLens2 p ARFoundation(ARKit/ARCore) Run On Each Device
p HoloLens2 p ARFoundation(ARKit/ARCore) Run On Each Device
Setting for HoloLens2 ① model ② Spatial Awareness
Setting for HoloLens2 See Windows Mixed Reality Spatial Mesh Observer
Setting for HoloLens2 Open dropdown menu aligned on right of
Type
Setting for HoloLens2 ①MicrosoftMixedReality.Toolkit.WindowsMixedReality.SpatialAwareness ②MicrosoftMixedReality.Spatial.MeshObserver
Build -> Deploy -> Run Installation
None
p HoloLens2 p ARFoundation(ARKit/ARCore) Run On Each Device
p HoloLens2 p ARFoundation(ARKit/ARCore) Run On Each Device
Setting for AR Foundation ①MixedRealityToolkit ②See Mixed Reality Toolkit
Setting for AR Foundation MobileMixedRealityToolkitConfiguration (The setting made in the
first half of tutorial)
Letʼs use plane detection instead of spatial awareness.
Using Plane Detection ①MixedRealityPlayspace ②Add Component
Using Plane Detection ①SearchAR Plane ②AR Plane Manager
Using Plane Detection ①MixedRealityPlayspace AR Session Origin & AR Plane
Manager should be added
Using Plane Detection Right click on the blank of Hierarchy
Using Plane Detection ①XR ②AR Default Plane
Using Plane Detection ①See AR Default Plane ②Assets
Using Plane Detection Drag&Drop AR Default Plane into Assets
Using Plane Detection Delete AR Default Plane
Using Plane Detection ①MixedRealityPlayspace ②See Plane Prefab
Using Plane Detection ①SeeAR Default Plane (※ Do NOT click)
②Drag & Drop into None aligned right of Plane Prefab
Using Plane Detection Plane Prefab should be AR Default Plane
Build -> Deploy -> Run Installation
None
Fin.