Submit Search
Upload
第7回 HoloLens参考書読書会 @アカツキ Ch8. Sharingのはなし
•
Download as PPTX, PDF
•
3 likes
•
2,404 views
daisuke yamanaka
Follow
第7回 HoloLens参考書読書会@アカツキでの発表資料です
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 92
Download now
Recommended
.NET Conf 2018 Tokyo MixedRealityなシステムを気持ちよく開発しよう
.NET Conf 2018 Tokyo MixedRealityなシステムを気持ちよく開発しよう
daisuke yamanaka
20171218_HoloLens読書会vol.2発表資料
20171218_HoloLens読書会vol.2発表資料
daisuke yamanaka
Holo meetup3 lt_yamanaka
Holo meetup3 lt_yamanaka
daisuke yamanaka
WebRTCとHoloLens
WebRTCとHoloLens
daisuke yamanaka
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
Recommended
.NET Conf 2018 Tokyo MixedRealityなシステムを気持ちよく開発しよう
.NET Conf 2018 Tokyo MixedRealityなシステムを気持ちよく開発しよう
daisuke yamanaka
20171218_HoloLens読書会vol.2発表資料
20171218_HoloLens読書会vol.2発表資料
daisuke yamanaka
Holo meetup3 lt_yamanaka
Holo meetup3 lt_yamanaka
daisuke yamanaka
WebRTCとHoloLens
WebRTCとHoloLens
daisuke yamanaka
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
More Related Content
Featured
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Featured
(20)
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
第7回 HoloLens参考書読書会 @アカツキ Ch8. Sharingのはなし
1.
2018/04/19 山中 大輔 第7回 HoloLens参考書読書会 @アカツキ Ch8.
Sharingのはなし
2.
もくじ ・Sharingをするうえで最も大事なこと ・座標系とは ・座標系の共有とは ・Sharingするときの通信方式 ・学習に役立ちそうなMRTKのサンプル ・参考書のサンプルについて
3.
Sharingとは ・複数台のHoloLensで空間を共有するしくみ ・現実空間の同じ場所に同じモノが見えるようになる ユニティちゃん かわいい! うしろ姿も とてもキュート!
4.
Sharingを作るときに考えがちなこと UNETとMRTK使うの どっちがいいかな? アンカーの共有とか Vuforiaってのが大事らしいとりあえずサンプル さわってみるか… ユニティちゃん かわいい
5.
それよりも大事なことがある!
6.
それを説明します
7.
デバイス間で座標系を共有する! X Y Z
8.
は? 座標系?
9.
モノの位置はどうやって表す? ・Unityでは座標を使ってモノの位置を決めている X軸 Y軸 原点(0,0) ユニティちゃんの位置 (4,3) 簡単のため2次元
10.
座標系(Coordinate System) X軸 原点(0,0) (4,3) Y軸 ・原点 と
基準となる軸 によって位置を定める仕組みを 座標系 という 1 2 3 4 123 (1,6) (6,5) 基準となる軸 基準となる軸 超大事
11.
大切な二つの座標系 ワールド 座標系 ローカル
座標系
12.
ワールド座標系 ・三次元空間内で空間全体を表す、基準となるたった1つの座標系 ワールドX軸 ワールドY軸 ワールド原点(0,0) ユニティちゃんの位置の ワールド座標⇒(4,3) 簡単のため2次元
13.
ローカル座標系 ・オブジェクトの位置と向きを基準にした座標系 ワールドX軸 ワールドY軸 ワールド原点(0,0) 簡単のため2次元 ローカルX軸 ローカルY軸 ローカル原点
14.
ローカル座標系 ・オブジェクトの向きが変われば、ローカル座標系の向きも変わる ワールドX軸 ワールドY軸 ワールド原点(0,0) 簡単のため2次元 ローカルX軸 ローカルY軸 ローカル原点
15.
ローカル座標系 ・ワールド座標系と違い、オブジェクトの数だけローカル座標系は存在する ワールドX軸 ワールドY軸 ワールド原点(0,0) 簡単のため2次元 ローカルX軸 B ローカルY軸A ローカルX軸AローカルX軸C ローカルY軸 B ローカルY軸
C
16.
ワールド座標とローカル座標 ・例として、ユニティちゃんの子にCubeがいる状況を考える 簡単のため2次元 ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸HierarchyView モデルの位置関係 親 子
17.
ワールド座標 とローカル座標 簡単のため2次元 ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸 Cubeの ワールド
座標 transform.position = (5,2) 1 2 3 4 5 12 ・ワールド座標はワールド原点とワールドX軸/Y軸をもとに計算する
18.
ワールド座標と ローカル座標 簡単のため2次元 ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸 Cubeの ローカル
座標 transform.localposition=???? ・Unityでは、ローカル座標は親が基準となる 親 子
19.
簡単のため2次元 ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸 Cubeの ローカル 座標 transform.localposition=???? ・Cubeはユニティちゃんの子なので、ユニティちゃんの位置と向きが基準 ローカル原点 ワールド座標と
ローカル座標
20.
ワールド座標と ローカル座標 簡単のため2次元 ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸 Cubeの ローカル
座標 transform.localposition=???? ・ユニティちゃんを規準として数え上げた座標がCubeのローカル座標 ローカル原点
21.
ワールド座標と ローカル座標 ※だいたいの値です ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸 Cubeの ローカル
座標 transform.localposition = (4.2, 0.2)ローカル原点 ・ユニティちゃんを規準として数え上げた座標がCubeのローカル座標
22.
ワールド座標とローカル座標 簡単のため2次元 ワールドX軸 ワールドY軸 ワールド原点(0,0) ローカルX軸 ローカルY軸 ユニティちゃんの場合 ワールド座標 ローカル座標 transform.position = (2,5) transform.localposition
= (2,5) ユニティちゃんモデルは親を持たない 最上位のオブジェクトなので、 ローカル座標系の基準はワールド座標系 1 2 12345
23.
ちなみに… ・InspectorViewのTransformは ローカル座標系 なので注意!!!
24.
Sharing のはなしに戻ります
25.
デバイス間で座標系を共有する! X Y Z
26.
座標系が何かはわかったけど 共有とは???
27.
HoloLensアプリのワールド座標系 ワールド原点 ⇒ アプリを起動したときのHoloLensの位置 +Z軸 ⇒
起動時の視線方向(地面に水平) +Y軸 ⇒ ジャイロで計測した天井方向 +X軸 ⇒ 起動時の右手方向(地面に水平) ・HoloLensではアプリを起動したときに、ワールド座標系が決まる
28.
ワールド座標系を使ってSharing? ・仮に2台のHoloLensが次のようにワールド座標系を持っていたとする ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens B
29.
ワールド座標系を使ってSharing? ・HoloLensAは (x, z)
= (1,1) の位置に表示したモデルをSharingしたい ZA軸 XA軸 ZB軸 XB軸HoloLens A HoloLens B ワールド(1,1)
30.
ワールド座標系を使ってSharing? ・HoloLensAは (x, z)
= (1,1) の位置に表示したモデルをSharingしたい ZA軸 XA軸 ZB軸 XB軸HoloLens A HoloLens B ワールド(1,1)
31.
ワールド(1,1) ワールド座標系を使ってSharing? ・HoloLens Bは考える… ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens
B ワールド(1,1) ってことは…
32.
ワールド(1,1) ワールド座標系を使ってSharing? ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens B ここか!!! ・HoloLens
Bは考える… ワールド(1,1)
33.
ワールド座標系を使ってSharing? ZB軸 XB軸 HoloLens B ・あれ…? ZA軸 XA軸 HoloLens A ワールド(1,1) ワールド(1,1)
34.
ワールド座標系を使ってSharing? ZB軸 XB軸 HoloLens B ZA軸 XA軸 HoloLens A 見てる方向が全然ちがう… ワールド(1,1) ワールド(1,1)
35.
なにがダメだったか ・HoloLensアプリは起動時にワールド座標が決まるので、 起動したときの位置や向きが異なると、同じワールド座標でも 現実空間での位置は違う場所を指すこととなる ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens B
36.
じゃあどうする?
37.
デバイス間で座標系を共有する! ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens B ・現実空間に紐づくようなオブジェクトを2台のHoloLensアプリ内に 配置して、そのオブジェクトのローカル座標系の座標で表示位置を決める 何か
38.
ローカル座標系を使ってSharing ZA軸 XA軸 ZB軸 XB軸HoloLens A HoloLens B ローカル
(1,1) 何か ・配置したオブジェクトのローカル座標(1,1)にモデルを設置してSharing
39.
ローカル座標系を使ってSharing ・HoloLens Bは考える… ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens
B ローカル (1,1) 何か ローカル(1,1) ってことは…
40.
ローカル座標系を使ってSharing ・HoloLens Bは考える… ZA軸 XA軸 HoloLens A ZB軸 XB軸 HoloLens
B 何か ローカル (1,1) ここか!!!
41.
ローカル座標系を使ってSharing ・無事、同じ場所にユニティちゃんがいることを確認できました。 ZB軸 XB軸 HoloLens B 何か ローカル (1,1) ZA軸 XA軸 HoloLens
A
42.
なんとなく理屈はわかったけど、 「何か」ってなに?
43.
「何か」を実現する方法 1. ワールドアンカー 2.Vuforia 3. HoloLensのワールド座標
44.
ワールドアンカー ・オブジェクトを 現実空間に関連付けて 配置する機能 (超わかりやすい資料@イワケン:https://www.slideshare.net/IwasakiKenta/6-hololens) ワールドアンカーも ローカル座標系も持ってる
45.
ワールドアンカーの共有方法 ・ワールドアンカーはシリアライズ/デシリアライズできる WorldAnchorTransferBatch (Unity API) 0110101….
0110101…. ExportAsync ImportAsync NW経由で送信
46.
ワールドアンカーを使ってSharing ・ワールドアンカーのローカル座標系を使って位置を知らせる ZB軸 XB軸 HoloLens B ローカル (1,1) ZA軸 XA軸 HoloLens
A 共有したアンカー
47.
ワールドアンカーの共有方法 ・MRTKのSharingStage.prefabを使えばアンカーの共有は自動でやってくれる
48.
ワールドアンカーによるSharing ・メリットもあれば、デメリットもある ■メリット ・ユーザは何もしなくてよい。 ・MRTKを使えば、アンカー共有は 簡単にできる。 ・時間経過によるドリフトが 発生しても、OS側で修正してくれる。 ■デメリット ・アンカーのデータサイズがMB単位に なることもあり、NWを 逼迫させることもある。 ・複数台のHoloLensで、しっかり 環境認識をやっておかないと、 位置がズレる。最悪共有に失敗する。 ・MRTKの実装はかなり複雑。 一部はネイティブ実装。
49.
MRTKのワールドアンカーの共有方法を 詳しく知りたい人はこちら ⇓ HoloToolkitのサンプルSharingTestの中身を見る http://blog.d-yama7.com/archives/643
50.
Vuforia [引用] - https://library.vuforia.com/ ・マーカ認識型ARアプリ用のライブラリ ・HoloLensでも使える
51.
Vuforiaによるマーカー認識 ・HoloLensにてVuforiaマーカーを認識したとき、マーカーの位置と向き、 すなわちマーカーのローカル座標系を知るための情報が取得できる マーカーの ローカルZ軸 マーカーの ローカルX軸 マーカーのワールド座標 (ローカル原点) マーカー
52.
Vuforiaを使ってSharing ・はじめにSharingする全てのHoloLensにてマーカーを認識する ・認識したマーカーのローカル座標系をもとに位置を知らせる ZB軸 XB軸 HoloLens B ローカル (1,1) ZA軸 XA軸 HoloLens
A マーカー
53.
VuforiaによるSharing ・メリットもあれば、デメリットもある ■メリット ・基準点を共有するために NWを使用しない。 ・アンカーの共有に比べて、 位置ズレは少ない。 ・実装も比較的簡単である。 ■デメリット ・基準点を共有するために、ユーザに 本来の体験とは関係ない作業を強いる。 ・一度マーカーを認識したのち、 時間経過によるモデルのドリフトが 発生した場合、マーカーの 再認識が必要となる。
54.
Vuforiaによる基準点の共有方法を 詳しく知りたい人はこちら ⇓ Vuforiaを使ってSharingの接続成功率をあげる http://blog.d-yama7.com/archives/600
55.
HoloLensのワールド座標の特性を活かす ワールド原点 ⇒ アプリを起動したときのHoloLensの位置 +Z軸 ⇒
起動時の視線方向(地面に水平) +Y軸 ⇒ ジャイロで計測した天井方向 +X軸 ⇒ 起動時の右手方向(地面に水平) ・HoloLensはアプリを起動したときに、ワールド座標系が決まる
56.
HoloLensのワールド座標の特性を活かす ・HoloLensを同じ場所で起動すれば、ワールド座標系は(だいたい)一致する
57.
HoloLensのワールド座標によるSharing ・メリットもあれば、デメリットもある ■メリット ・基準点の共有のための実装はなし。 ・モデルの共有も、ワールド座標を ただ知らせればよい。 ■デメリット ・基準点を共有するために、ユーザに 本来の体験とは関係ない作業を強いる。 ・モデルのドリフトが発生しても、 キャリブレーションする方法がない
58.
HoloLensのワールド座標による 基準点の共有方法を 詳しく知りたい人はこちら ⇓ お手軽にSharingの接続成功率と精度をあげる http://blog.d-yama7.com/archives/569
59.
Sharingを理解するうえで最も大切なことは、 デバイス間でどうやって 基準となる座標系を共有するか
60.
Sharingでの通信方法はどうするか ・Raknetを使う(MRTKに昔からあるやつ) ・UNETを使う(MRTKでも使われている) ・Socket通信で実装する ・Photonを使う ・WebSocketで通信する ・特に制限はないので、なじみのあるNWライブラリを使うとよい
61.
Sharingでの通信方法はどうするか ・Raknetを使う(MRTKに昔からあるやつ) ・UNETを使う(MRTKでも使われている) ・Socket通信で実装する ・Photonを使う ・WebSocketで通信する ・とはいえMRTKのサンプルを参考にするのが導入としては良い
62.
Sharingでの通信方法はどうするか ・感覚的にはオンラインゲームを作ることに近い ・後からSharingの機能を加えようとすると死ねる ・なので初期の段階からSharingを意識したアプリの設計が必要 [SBクリエイティブ] - http://www.sbcr.jp/products/4797375916.html @izm
- https://twitter.com/izm/status/970349481869766656
63.
Sharingについてわかってきたところで、 MRTKのサンプルを動かしてみよう!
64.
SharingTest ・SharingしているHoloLens上にCubeが重畳表示される
65.
導入 ・HoloToolkit-UnityとHoloToolkit-Unity-Exampleをプロジェクトにインポート
66.
構成 HoloLens A HoloLens
B PC内の SharingService.exe お互いのHoloLensの 位置と向きを サーバを介して交換 受信した位置と向き、 すなわち相手の HoloLens上にCubeを表示
67.
おおまかな流れ 1. サーバへの接続 2. アンカーのアップロードとダウンロード 3.
HoloLensの位置を送受信
68.
サーバの起動 ・githubからダウンロードしてくる https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/External/HoloToolkit/Sharing/Server/SharingService.exe
69.
サーバの起動 ・コマンドプロンプトから起動する
70.
サーバへの接続 ・MRTKのSharingStage.csとAutoJoinSessionAndRoo.csがやってくれる ・SharingStageのServerAddressに、SharingService.exeを動かす端末のIPを指定する
71.
アンカーのアップロードとダウンロード ・SharingWorldAnchorManager.csが全部勝手にやってくれる(はず…)
72.
HoloLensの位置を送受信 ・CustomMessage.csとRemoteHeadManager.csで処理している
73.
HoloLensの位置を送受信 ・CustomMessage.csはサーバへのメッセージ送受信を行う ・RemoteHeadManager.csはメッセージをもとにCubeの表示の制御を行う HoloLens A HoloLens
B SharingService.exeRemoteHead Manager Custom Message RemoteHead Manager Custom Message
74.
HoloLensの位置を送受信 HoloLens A HoloLens
B SharingService.exeRemoteHead Manager Custom Message RemoteHead Manager Custom Message 改造するならココ
75.
CustomMessageと RemoteHeadManagerの 実装を詳しく知りたい方はこちら ⇓ HoloToolkitのサンプルSharingTestの中身を見る http://blog.d-yama7.com/archives/643
76.
参考書のサンプルを動かしてみよう
77.
サンプルの内容 ・SpatialMappingでスキャンしたメッシュ状にSkee(ゲーム筐体)を設置する ・設置されたSkeeは、Sharingしているデバイス間でTransformが同期される
78.
環境 MRTKのSharingまわりのスクリプトはここ一年で大きく変化している ■参考書のままやりたい Unity 2017.1.2f1 ■最新の環境でやりたい Unity 2017.2.2p3
がオススメ ⇒Unity 2017.2.2p1未満は安定化平面にバグがある ⇒Unity 2017.3以降(2017.4も含む)はUnityWebRequestにバグがある
79.
プロジェクトの準備 ・githubからパッケージをダウンロードしてインポートする https://github.com/PacktPublishing/HoloLens-Beginners-Guide/blob/master/Chapter08/chapter8before.unitypackage
80.
シーン上のSkeeをいったん消す
81.
Sharingプレハブを配置する
82.
PrefabSpawnManagerを配置する
83.
PrefabSpawnManagerを設定する 1 2 3 1. Sizeを「1」に指定 2. DataModelClassNameを 「SyncSpawnedObject」と指定 3.
Prefabに「skee」を指定
84.
PrefabSpawnManagerの役割 ・指定したプレハブを生成するファクトリメソッドを提供してくれる ・このファクトリメソッドを経由して生成したプレハブのtransformは、 自動的にSharingしているデバイス間で同期される
85.
SyncSpawnSkee.csを新しく作る ・SyncSpawnedObjectが、デバイス間でTransformを同期してくれるヘルパー ・SpawnManager.Spawnがファクトリメソッド
86.
SyncSpawnSkeeを設定する ・AppManagerにSyncSpawnSkeeをアタッチする
87.
Skeeプレハブにスクリプトを追加する ・ImportExportAnchorManagerはアンカーのアップロード/ダウンロードを行う SharingWorldAnchorManagerと同じような働き
88.
ApplicationManager.csを修正する ⇒ コードの詳細は参考書やgithubを参照してください ・アプリケーションの状態を定義し、状態に応じて処理をswitch ・状態はAirTapなどのジェスチャーで変更する
89.
ApplicationManagerを設定する ・ApplicationManagerは内部でSpatialMappingやSharingStageを参照している
90.
SharingServiceを起動して動作確認 https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/v1.2017.1.0/External/HoloToolkit/Sharing/Server/SharingService.exe ・最新版だと動作しないので、一世代前のexeを用意する
91.
まとめ ・最も大切なことは、いかに座標系を共有するか ・通信方式は好きなものを使えばよい ・ネットワークアプリケーションとしてどのように設計するかが重要
Download now