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
ARコンテンツ作成勉強会:VuforiaでつくるスマホAR+VRアプリ
Search
shinjism
October 13, 2018
Technology
0
750
ARコンテンツ作成勉強会:VuforiaでつくるスマホAR+VRアプリ
Unity Asset Storeで公開されているVuforia AR+VR Sampleを用いたスマホアプリ作成ハンズオンでのスライド
shinjism
October 13, 2018
Tweet
Share
More Decks by shinjism
See All by shinjism
OpenCVでつくろうARスタンプアプリ for iOS
shinjism
0
130
個人的にお気に入りのVuforia公式サンプル #AR_Fukuoka
shinjism
0
93
A-Frameでお手軽WebAR
shinjism
1
4.1k
日本語でおk?
shinjism
0
220
Other Decks in Technology
See All in Technology
『AWS Distinguished Engineerに学ぶ リトライの技術』 #ARC403/Marc Brooker on Try again: The tools and techniques behind resilient systems
quiver
0
130
ビジネスと現場活動をつなぐソフトウェアエンジニアリング~とあるスタートアッププロダクトの成長記録より~
mizunori
0
210
リアルタイム分析データベースで実現する SQLベースのオブザーバビリティ
mikimatsumoto
0
950
Datadogとともにオブザーバビリティを布教しよう
mego2221
0
130
技術的負債解消の取り組みと専門チームのお話 #技術的負債_Findy
bengo4com
1
1.2k
CZII - CryoET Object Identification 参加振り返り・解法共有
tattaka
0
240
転生CISOサバイバル・ガイド / CISO Career Transition Survival Guide
kanny
3
410
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.5k
High Performance PHP
cmuench
0
140
Ask! NIKKEIの運用基盤と改善に向けた取り組み / NIKKEI TECH TALK #30
kaitomajima
1
450
個人開発から公式機能へ: PlaywrightとRailsをつなげた3年の軌跡
yusukeiwaki
11
2.7k
「海外登壇」という 選択肢を与えるために 〜Gophers EX
logica0419
0
500
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Code Reviewing Like a Champion
maltzj
521
39k
Code Review Best Practice
trishagee
66
17k
Agile that works and the tools we love
rasmusluckow
328
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Building Your Own Lightsaber
phodgson
104
6.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
310
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
None
◼ ◼ ◼ ◼
◼ ◼ ◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
◼ ◼
◼ ◼ ◼
None
None
◼ ◼ ◼
◼
None
◼ ◼
None
None
◼ ◼ ◼ ◼
None
None
None
None
◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る // 上下キーの入力を受け取る // X軸とY軸を回転させる } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る // 上下キーの入力を受け取る // X軸とY軸を回転させる } }
None
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る // X軸とY軸を回転させる } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る // X軸とY軸を回転させる } }
None
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る float x = Input.GetAxis("Vertical") * -1; // X軸とY軸を回転させる } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る float x = Input.GetAxis("Vertical") * -1; // X軸とY軸を回転させる } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る float x = Input.GetAxis("Vertical") * -1; // X軸とY軸を回転させる transform.Rotate(x, y, 0); } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る float x = Input.GetAxis("Vertical") * -1; // X軸とY軸を回転させる transform.Rotate(x, y, 0); } }
/* 省略 */ public class UserHeadRotation : MonoBehaviour { //
オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start () { } // フレームが更新される度に呼ばれる関数 void Update () { // 左右キーの入力を受け取る float y = Input.GetAxis("Horizontal"); // 上下キーの入力を受け取る float x = Input.GetAxis("Vertical") * -1; // X軸とY軸を回転させる transform.Rotate(x, y, 0); } }
◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
◼ ◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
◼ ◼
None
None
None
◼ ◼
◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
◼ ◼
None
None
◼ ◼
None
None
None
None
None
None
None
None
None
◼ ◼
None
None
None
◼ ◼
None
None
◼ ◼
None
None
None
#region PUBLIC_MEMBER_VARIABLES static public bool isFullScreenMode = true; public GameObject[]
AROnlyObjects; public GameObject[] VROnlyObjects; [Range(0.1f, 5.0f)] public float transitionDuration = 1.5f; // seconds public Canvas StereoViewDivider; public Animator m_Astronaut, m_Drone; public bool InAR { get { return mTransitionCursor <= 0.66f; } } #endregion PUBLIC_MEMBER_VARIABLES
#region PUBLIC_MEMBER_VARIABLES static public bool isFullScreenMode = true; public GameObject[]
AROnlyObjects; public GameObject[] VROnlyObjects; [Range(0.1f, 5.0f)] public float transitionDuration = 1.5f; // seconds public Canvas StereoViewDivider; public Animator m_Astronaut, m_Drone; public bool InAR { get { return mTransitionCursor <= 0.66f; } } #endregion PUBLIC_MEMBER_VARIABLES
void UpdateVisibleObjects() { foreach (var go in VROnlyObjects) { go.SetActive(!InAR);
} // Start Astronaut and Drone animations in VR mode if (!InAR) { if (m_Astronaut) { m_Astronaut.SetBool("IsDrilling", !InAR); } if (m_Drone != null) { m_Drone.SetBool("IsScanning", !InAR); m_Drone.SetBool("IsShowingLaser", !InAR); m_Drone.SetBool("IsFacingObject", !InAR); } } }
void UpdateVisibleObjects() { foreach (var go in VROnlyObjects) { go.SetActive(!InAR);
} // Start Astronaut and Drone animations in VR mode if (!InAR) { if (m_Astronaut) { m_Astronaut.SetBool("IsDrilling", !InAR); } if (m_Drone != null) { m_Drone.SetBool("IsScanning", !InAR); m_Drone.SetBool("IsShowingLaser", !InAR); m_Drone.SetBool("IsFacingObject", !InAR); } } }
◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
◼ ◼
None
None
None
None
None
None
None
None
None
None
None
None
None
None
/* 省略 */ public class SceneControllerScript : MonoBehaviour { /*
省略 */ public void OnAssembleButton() { pt = 0f; panelFlag = !panelFlag; } // ドアを開ける関数 // ドアを閉める関数 }
/* 省略 */ public class SceneControllerScript : MonoBehaviour { /*
省略 */ public void OnAssembleButton() { pt = 0f; panelFlag = !panelFlag; } // ドアを開ける関数 public void OpenDoor () { dt = 0f; doorFlag = true; } // ドアを閉める関数 public void CloseDoor () { dt = 1f; doorFlag = false; } }
None
None
None
None
None
None
#region PRIVATE_MEMBER_VARIABLES float mFocusedTime; bool mTriggered; TransitionManager mTransitionManager; Transform cameraTransform;
#endregion // PRIVATE_MEMBER_VARIABLES /* 省略 */ // オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start() { cameraTransform = Camera.main.transform; mTransitionManager = FindObjectOfType<TransitionManager>(); GetComponent<Renderer>().material = nonFocusedMaterial; }
#region PRIVATE_MEMBER_VARIABLES float mFocusedTime; bool mTriggered; TransitionManager mTransitionManager; Transform cameraTransform;
SceneControllerScript danbocchi; #endregion // PRIVATE_MEMBER_VARIABLES /* 省略 */ // オブジェクトが有効になった時に1度だけ呼ばれる関数 void Start() { cameraTransform = Camera.main.transform; mTransitionManager = FindObjectOfType<TransitionManager>(); GetComponent<Renderer>().material = nonFocusedMaterial; danbocchi = GetComponent<SceneControllerScript>(); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; danbocchi.OpenDoor(); // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
◼ ◼
None
None
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; danbocchi.OpenDoor(); // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く // ドアが開くまで待つ(1秒待機) // AR←→VRの移行 } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く // ドアが開くまで待つ(1秒待機) // AR←→VRの移行 } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く danbocchi.OpenDoor(); // ドアが開くまで待つ(1秒待機) // AR←→VRの移行 } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く danbocchi.OpenDoor(); // ドアが開くまで待つ(1秒待機) // AR←→VRの移行 } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く danbocchi.OpenDoor(); // ドアが開くまで待つ(1秒待機) // AR←→VRの移行 bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く danbocchi.OpenDoor(); // ドアが開くまで待つ(1秒待機) // AR←→VRの移行 bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く danbocchi.OpenDoor(); // ドアが開くまで待つ(1秒待機) yield return new WaitForSeconds(1.0f); // AR←→VRの移行 bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; danbocchi.OpenDoor(); // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; danbocchi.OpenDoor(); // Activate transition from AR to VR or vice versa bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // AR←→VR移行をコルーチンとして呼び出す }
// フレームが更新される度に呼ばれる関数 void Update() { /* 省略 */ if (Focused)
{ // Update the "focused state" time mFocusedTime += Time.deltaTime; if ((mFocusedTime > activationTime) || startAction) { mTriggered = true; mFocusedTime = 0; // AR←→VR移行をコルーチンとして呼び出す StartCoroutine(TransitionXRMode()); }
◼ ◼
None
None
#region PRIVATE_METHODS private void UpdateMaterials(bool focused) { /* 省略 */
} private IEnumerator TransitionXRMode() { // ドアを開く danbocchi.OpenDoor(); // ドアが開くまで待つ(1秒待機) yield return new WaitForSeconds(1.0f); // AR←→VRの移行 bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER); mTransitionManager.Play(goingBackToAR); StartCoroutine( ResetAfter(0.3f * mTransitionManager.transitionDuration) ); } private IEnumerator ResetAfter(float seconds) { /* 省略 */ } #endregion // PRIVATE_METHODS
private IEnumerator ResetAfter(float seconds) { Debug.Log("Resetting View trigger after: "
+ seconds); yield return new WaitForSeconds(seconds); Debug.Log("Resetting View trigger: " + name); // Reset variables mTriggered = false; mFocusedTime = 0; Focused = false; UpdateMaterials(false); }
private IEnumerator ResetAfter(float seconds) { Debug.Log("Resetting View trigger after: "
+ seconds); yield return new WaitForSeconds(seconds); Debug.Log("Resetting View trigger: " + name); // ドアを閉じる // Reset variables mTriggered = false; mFocusedTime = 0; Focused = false; UpdateMaterials(false); }
private IEnumerator ResetAfter(float seconds) { Debug.Log("Resetting View trigger after: "
+ seconds); yield return new WaitForSeconds(seconds); Debug.Log("Resetting View trigger: " + name); // ドアを閉じる danbocchi.CloseDoor(); // Reset variables mTriggered = false; mFocusedTime = 0; Focused = false; UpdateMaterials(false); }
◼ ◼
None
None
None
None
◼ ◼
None
None
None
None
None
None
None
/* 省略 */ public class SceneControllerScript : MonoBehaviour { /*
省略 */ public void OnAssembleButton() { pt = 0f; panelFlag = !panelFlag; } // ドアを開ける関数 public void OpenDoor () { dt = 0f; doorFlag = true; } // ドアを閉める関数 public void CloseDoor () { dt = 1f; doorFlag = false; } }
/* 省略 */ public class SceneControllerScript : MonoBehaviour { /*
省略 */ public void OnAssembleButton() { pt = 0f; panelFlag = !panelFlag; } // ドアを開ける関数 public void OpenDoor () { dt = 0f; doorFlag = true; GetComponent<AudioSource>().Play(); } // ドアを閉める関数 public void CloseDoor () { dt = 1f; doorFlag = false; } }
◼ ◼
None
None
None
◼ ◼ ◼ ◼
None
None
None
None
◼ ◼
None
None
None
None
None
None
None
None
◼ ◼
◼ ◼ ◼
None
◼ ◼
None
None
None
None
None
None
None
None
None
◼ ◼
None
None
◼ ◼ ◼