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
600
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
120
個人的にお気に入りのVuforia公式サンプル #AR_Fukuoka
shinjism
0
82
A-Frameでお手軽WebAR
shinjism
1
4k
日本語でおk?
shinjism
0
220
Other Decks in Technology
See All in Technology
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
7
100k
Challenges - Open Farming Hackdays 2024
loleg
0
530
プッシュ型子育てサービスを、先行プロジェクト実施自治体において開始します
govtechtokyo
0
240
データマネジメントを支える武器としてのメタデータ管理
10xinc
1
340
技育祭2024春 LT Finatextホールディングス
kevinrobot34
1
160
生成AIサービスPanorama AIご説明資料
sdt
0
300
Autify Company Deck
autifyhq
1
30k
マイクロサービス環境におけるDB戦略 in DMMプラットフォーム
pospome
11
3k
LLMプロダクト事業の立ち上げにおける挑戦
layerx
PRO
7
1.4k
ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP
yuitosato
29
11k
技術イベントはなんとかひねり出す 日経の技術広報の取り組み/techpr3
nishiuma
0
220
8週連続ウェビナー_イチから学ぶFivetran
cmsuzu
0
160
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
Typedesign – Prime Four
hannesfritz
36
2k
Designing for Performance
lara
601
67k
The Brand Is Dead. Long Live the Brand.
mthomps
48
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
8
8.2k
Rails Girls Zürich Keynote
gr2m
91
13k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Making Projects Easy
brettharned
106
5.4k
4 Signs Your Business is Dying
shpigford
174
21k
How GitHub (no longer) Works
holman
301
140k
Building Applications with DynamoDB
mza
88
5.6k
Principles of Awesome APIs and How to Build Them.
keavy
119
16k
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
◼ ◼ ◼