Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The magic box: Google Cardboard

The magic box: Google Cardboard

by Andrea Lucibello & Luca Piras
Talk at droidcon Italy 2015

Avatar for droidcon Italy

droidcon Italy

March 14, 2017
Tweet

More Decks by droidcon Italy

Other Decks in Technology

Transcript

  1. The magic box: Google Cardboard Introduction to Cardboard development and

    practical use with augmented reality Andrea Lucibello Android developer @ Synesthesia +AndreaLucibello @andreoid82 Luca Piras Android developer @ Synesthesia +LucaPiras0 @chivaspip
  2. NO

  3. NO

  4. The perception is created by surrounding the user of the

    VR system in images, sound or other stimuli that provide an engrossing total environment. “ ”
  5. Include Jars • download jars from: https://developers.google.com/cardboard/android/download • include jars

    in your project • make sure your build.gradle include the following lines dependencies { ... compile fileTree(dir: ‘libs’, include: [‘*.jar’]) }
  6. Layout <?xml version=”1.0” encoding=”utf-8”?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/ui_layout” android:layout_width=”match_parent” android:layout_height=”match_parent” >

    <com.google.vrtoolkit.cardboard.CardboardView android:id=”@+id/cardboard_view” android:layout_width=”match_parent” android:layout_height=”match_parent”/> </RelativeLayout>
  7. Cardboard Activity public class MyActivity extends CardboardActivity { … …

    … @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.common_ui); cardboardView = (CardboardView) findViewById(R.id.cardboard_view); cardboardView.setRenderer(new MyRender()); setCardboardView(cardboardView); }
  8. Stereo Render public class MyRender implements CardboardView.StereoRender { … …

    … public void onNewFrame (HeadTransform headTransform); public void onDrawEye (Eye eye); public void onFinishFrame (Viewport viewport);
  9. onNewFrame public void onNewFrame (HeadTransform headTransform); • called at the

    begginning of each new frame • gives us the HeadTransform which tracks the orientation of the device
  10. onDrawEye public void onDrawEye (Eye eye); • It’s called 2

    times for each frame (2 eyes) • Give us the eye to render, including the transformations to be applied.
  11. onFinishFrame public void onFinishFrame (Viewport viewport); • Called before a

    frame is finished • Used to add additional overlay rendering over the frame results
  12. • Google Nexus 5 • Google Nexus 4 • Samsung

    Galaxy S2 • Samsung Galaxy S4 • OnePlus One • HTC One (new edition) Supported devices Did you know?
  13. Nexus 6: too large to fit in Cardboard. Samsung Galaxy

    S3: While the application works fine, the magnet did not. Apparently the magnometer sensor might be on the right side of the de- vice. SOLUTION: Detach and move the magnet to the right side of the head- set. Known Issues Did you know?
  14. Samsung Galaxy S3, S4 Mini (and other small devices): Screen

    too small. User can see but- tons while looking through the len- ses. Samsung Galaxy Notes: Most Note devices were too large to fit in Cardboard. Known Issues Did you know?
  15. Luca Piras Android developer @ Synesthesia +LucaPiras0 @chivaspip Andrea Lucibello

    Android developer @ Synesthesia +AndreaLucibello @andreoid82