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
Ask! NIKKEIの運用基盤と改善に向けた取り組み / NIKKEI TECH TALK #30
kaitomajima
1
450
Postmanを使いこなす!2025年ぜひとも押さえておきたいPostmanの10の機能
nagix
2
120
アジャイル開発とスクラム
araihara
0
160
関東Kaggler会LT: 人狼コンペとLLM量子化について
nejumi
3
460
The 5 Obstacles to High-Performing Teams
mdalmijn
0
270
モノレポ開発のエラー、誰が見る?Datadog で実現する適切なトリアージとエスカレーション
biwashi
6
770
リアルタイム分析データベースで実現する SQLベースのオブザーバビリティ
mikimatsumoto
0
950
Data-centric AI入門第6章:Data-centric AIの実践例
x_ttyszk
1
370
君はPostScriptなウィンドウシステム 「NeWS」をご存知か?/sunnews
koyhoge
0
720
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.5k
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
22
5.8k
Ask! NIKKEI RAG検索技術の深層
hotchpotch
13
2.8k
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Why Our Code Smells
bkeepers
PRO
335
57k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
What's in a price? How to price your products and services
michaelherold
244
12k
GraphQLとの向き合い方2022年版
quramy
44
13k
The World Runs on Bad Software
bkeepers
PRO
67
11k
The Cult of Friendly URLs
andyhume
78
6.2k
Building an army of robots
kneath
302
45k
Site-Speed That Sticks
csswizardry
3
370
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
RailsConf 2023
tenderlove
29
1k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
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
◼ ◼ ◼