webinar: giovanni laquidara - creare applicazioni vr

37
Creare applicazioni VR Giovanni Laquidara Milano 10-11 Novembre 2017

Upload: codemotion

Post on 21-Jan-2018

350 views

Category:

Technology


1 download

TRANSCRIPT

Creare applicazioni VR

Giovanni Laquidara

Milano 10-11 Novembre 2017

@joaolaq

XR Engineer, Mobile developer Giovanni Laquidara

www.laquysoft.com

@joaolaq@joaolaq

Mobile VR

@joaolaq@joaolaq

• Debut 2014 • Over 10 million shipped by Google (Q1 2017) • Over 88 million totally • 3DOF • Apps in Google Play specific section • Android and iOS!

https://vr.google.com/cardboard/

@joaolaq@joaolaq

• Debut 2016 • 250k in 2016 - 2.2 m in 2017 ( estimations ) • 3DOF + 3DOF Controller • Compatible only with 9 Top Smartphones ( Pixel, S8, LG VR30…) • Apps in Google Play specific section • 1480 x 1280 per eye

https://vr.google.com/daydream/smartphonevr/

@joaolaq@joaolaq

• Debut 2015 ( each year an updated version ) • 4.51 million units in 2016, more then Oculus+PSVR+HTC Vive combined • 3DOF + High performance sensors + 3DOF Controller • Compatible only with Samsung Top Smartphones (S6 up to S8/Note8) • Partnership with Oculus, dedicated App store • 1480 x 1440 per eye

http://www.samsung.com/global/galaxy/gear-vr/

@joaolaq@joaolaq

Cardboard

@joaolaq@joaolaq

Unity https://unity3d.com/

@joaolaq@joaolaq

Cardboard/Daydream Native support in

Unity (5.6+)

@joaolaq@joaolaq

Download Unity 5.6+Suggest Brand New 2017.1.1 but beware the bugs

@joaolaq@joaolaq

Download GoogleVRhttps://github.com/googlevr/gvr-unity-sdk/releases

@joaolaq@joaolaq

Import Google VR and Assets

@joaolaq@joaolaq

Open Sample Scene • Camera • Reticle

@joaolaq@joaolaq

Input?

• GvrEventSystem

@joaolaq@joaolaq

Let’s build and run!

@joaolaq@joaolaq

And on S8 It Crash :)

Could not recreate VR window because GfxDevice is in an invalid state (device lost)

@joaolaq@joaolaq

Solution:

Put Daydream Support before Cardboard ;)

@joaolaq@joaolaq

• DayDream! We can use the same SDK See the controller!

@joaolaq@joaolaq

Input • GvrControllerPointer

@joaolaq@joaolaq

void Update() {

  // Example: get controller's current orientation:  Quaternion ori = GvrController.Orientation;

  // If you want a vector that points in the direction of the controller  // you can just multiply this quat by Vector3.forward:  Vector3 vector = ori * Vector3.forward;

  // ...or you can just change the rotation of some entity on your scene  // (e.g. the player's arm) to match the controller's orientation  playerArmObject.transform.localRotation = ori;

  // Example: check if touchpad was just touched  if (GvrController.TouchDown) {    // Do something.    // TouchDown is true for 1 frame after touchpad is touched.  }

  // Example: check if app button was just released.  if (GvrController.AppButtonUp) {    // Do something.    // AppButtonUp is true for 1 frame after touchpad is touched.  }

  // Example: check the position of the user's finger on the touchpad  if (GvrController.IsTouching) {    Vector2 touchPos = GvrController.TouchPos;    // Do something.  }}

GvrController API

@joaolaq@joaolaq

• Build and Run

@joaolaq@joaolaq

• DayDream Elements!

@joaolaq@joaolaq

• GearVR Native support in Unity

• https://developer.oculus.com/downloads/package/oculus-utilities-for-unity-5/

@joaolaq@joaolaq

• Oculus Framework

@joaolaq@joaolaq

• Camera = OVRCameraRig

@joaolaq@joaolaq

• Controller

@joaolaq@joaolaq

// old way // if (Input.GetMouseButton(0)) // the finger has touched the HMD trackpad. // { // Vector2 touchPosition = Input.mousePosition; // ProcessClickAtPosition(touchPosition); // }

// new way // The Gear VR Controller has a clickable trackpad, so we can differentiate between // the finger simply touching the pad and actively depressing it.

// is player using a controller? if (OVRInput.GetActiveController() == OVRInput.Controller.LTrackedRemote || OVRInput.GetActiveController() == OVRInput.Controller.RTrackedRemote) { // yes, are they touching the touchpad? if (OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)) { // yes, let's require an actual click rather than just a touch. if (OVRInput.Get(OVRInput.Button.PrimaryTouchpad)) { // button is depressed, handle the touch. Vector2 touchPosition = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad); ProcessControllerClickAtPosition(touchPosition); } } } else if (OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)) // finger on HMD pad? { // not using controller, same behavior as before. Vector2 touchPosition = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad); ProcessHMDClickAtPosition(touchPosition); }

@joaolaq@joaolaq

Build and Run

@joaolaq@joaolaqBuild and Run

@joaolaq@joaolaq

https://dashboard.oculus.com/tools/osig-generator/

Put the downloaded file in your project directory Project/Assets/Plugins/Android/assets/

@joaolaq@joaolaq

Put the downloaded file in your project directory Project/Assets/Plugins/Android/assets/

Enable Developer Mode

1. Go to Settings > Application Manager 2. Select Gear VR Service 3. Select Manage Storage 4. Click on VR Service Version several times until the Developer Mode toggle shows up 5. Toggle Developer Mode

@joaolaq@joaolaq

Future HMDs - Daydream

@joaolaq@joaolaq

Future HMDs - Samsung Windows Mixed Reality

@joaolaq@[email protected] www.laquysoft.com

https://goo.gl/e6Dt9Z

Un Cardboard in palio :)estratto a sorte tra i partecipati al questionario:

Potete venire a trovarmi a Codemotion Milano!

Talk: Hello ARCore

Il 11 novembre, 11:30-12.10

Controlla l’email! C'è una speciale promozione

per te!

CODEMOTION MILANO 10-11 NOVEMBRE 2017http://milan2017.codemotionworld.com/

Ci vediamo a

Ricordati di controllare l’email!☺