SlideShare a Scribd company logo
1 of 13
Download to read offline
Coding a VR
Application
in Android
A Practical Guide
Virtual Reality @
CommonFloor
Virtual Reality @
CommonFloor
Contents
❖ Introduction to Google Cardboard SDK for Android
❖ Requirement of separate SDK for VR ?
❖ Getting Started with First Android Application for VR
❖ Setup of coding environment
❖ Overview of code
Intro to Google Cardboard
SDK
❖ Cardboard SDK for Android enables developers familiar with OpenGL to
quickly start creating VR applications.
❖ The toolkit simplifies many common VR development tasks, including:
❖ Lens distortion correction.
❖ Head tracking.
❖ 3D calibration.
❖ Side-by-side rendering.
❖ Stereo geometry configuration.
❖ User input event handling.
Setup of Coding Environment
❖ Building the demo app requires:
❖ Android Studio 1.0 or higher
❖ https://developer.android.com/sdk/index.html
❖ Version 19 of the Android SDK
❖ A physical Android device running Android 16 (Jelly
Bean) or higher
Lets start coding
❖ Main components of Android VR Application
❖ Manifest file
❖ Cardboard Activity
❖ Custom Renderer
❖ Content Model
Android Manifest File
Need to specify following permissions in manifest file
❖ NFC — Input Mechanism used by cardboard trigger button
<uses-permission android:name="android.permission.NFC" />
❖ Vibration Sensor — Haptic Feedback mechanism for certain events in Application
<uses-permission android:name="android.permission.VIBRATE" />
❖ Read and write to external storage
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
❖ Specify minimum and target SDK version
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19"/>
❖ Specify the OpenGL ES version that device must support to run the application
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
Cardboard Activity
❖ Starting point for coding a cardboard app.
❖ Base activity that provides easy integration with
Cardboard devices.
❖ Exposes events to interact with Cardboards.
❖ Uses sticky immersive mode, in which the system UI is
hidden, and the content takes up the whole screen.
Custom Renderer
❖ Custom Renderer for CardboardView
❖ Implements the CardboardView.StereoRenderer interface
❖ Delegates all stereoscopic rendering details to the view
❖ All stereoscopic rendering and distortion correction details are abstracted from the renderer and managed
internally by the view
❖ Overrides the following important methods
// Prepares OpenGL ES before we draw a frame.
// @param headTransform The head transformation in the new frame.
@Override
public void onNewFrame(HeadTransform headTransform) {
// Called when a new frame is about to be drawn.
// Any per-frame operations not specific to a single view should happen here.
}
@Override
public void onDrawEye(Eye eye) {
// Draw the frames for each eye
}
Custom Renderer
OnDrawEye Function
// Draws a frame for an eye.
// @param eye The eye to render. Includes all required transformations.
@Override
public void onDrawEye(Eye eye) {
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
. . .
// Apply the eye transformation to the camera.
Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0);
// Set the position of the light
Matrix.multiplyMV(mLightPosInEyeSpace, 0, mView, 0, LIGHT_POS_IN_WORLD_SPACE, 0);
// Build the ModelView and ModelViewProjection matrices
// for calculating cube position and light.
float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0);
Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0);
drawCube();
// Draw rest of the scene.
. . .
}
Content for VR - 3D Models
❖ Consists of any 3D model that we want to render in our application
❖ Can be a simple model like a sphere or cube
❖ Can be complex models of house, players etc to create a real 3D
scene.
Wrap it up and Lets Code !!!
3D
Assets
Carboard.jar
Google Cardboard
Android Application
Redistributable
APK
Cardboard SDK
Compatible
Android Phone
+ =
=
Android
Code +

More Related Content

What's hot

Virtual reality Presentation
Virtual reality PresentationVirtual reality Presentation
Virtual reality PresentationAnand Akshay
 
Google cardbord
Google cardbordGoogle cardbord
Google cardbordHarsh Shah
 
VIRTUAL REALITY & AUGMENTED REALITY
VIRTUAL REALITY & AUGMENTED REALITY VIRTUAL REALITY & AUGMENTED REALITY
VIRTUAL REALITY & AUGMENTED REALITY HarsshammJeetendra
 
Google cardboard presentation
Google cardboard presentationGoogle cardboard presentation
Google cardboard presentationDave Jones
 
Google Cardboard (DIY) with JUMP - Virtual Reality
Google Cardboard (DIY) with JUMP - Virtual RealityGoogle Cardboard (DIY) with JUMP - Virtual Reality
Google Cardboard (DIY) with JUMP - Virtual RealityKarthik Saravanan
 
Introducing virtual reality
Introducing  virtual  realityIntroducing  virtual  reality
Introducing virtual realitySagar Suvarnakar
 
Introduction to Virtual Reality (VR) for Business - Workshop
Introduction to Virtual Reality (VR) for Business - WorkshopIntroduction to Virtual Reality (VR) for Business - Workshop
Introduction to Virtual Reality (VR) for Business - WorkshopPaolo Tosolini
 
Market Based Analysis of Virtual Reality Products - IT Strategy
Market Based Analysis of Virtual Reality Products - IT StrategyMarket Based Analysis of Virtual Reality Products - IT Strategy
Market Based Analysis of Virtual Reality Products - IT StrategyMohitMhapuskar
 
Virtual Reality 2020
Virtual Reality 2020Virtual Reality 2020
Virtual Reality 2020Artefact
 
Designing UI and UX for Interactive Virtual Reality Apps
Designing UI and UX for Interactive Virtual Reality AppsDesigning UI and UX for Interactive Virtual Reality Apps
Designing UI and UX for Interactive Virtual Reality AppsrapidBizApps
 
Virtual reality-What you see is what you believe
Virtual reality-What you see is what you believe Virtual reality-What you see is what you believe
Virtual reality-What you see is what you believe kaishik gundu
 
Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)
Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)
Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)BDPA Education and Technology Foundation
 
Virtual Reality for Training, Learning, Education and Visualisation
Virtual Reality for Training, Learning, Education and VisualisationVirtual Reality for Training, Learning, Education and Visualisation
Virtual Reality for Training, Learning, Education and VisualisationDaden Limited
 
2016 Virtual Reality Presentation
2016 Virtual Reality Presentation2016 Virtual Reality Presentation
2016 Virtual Reality PresentationDave Jones
 

What's hot (20)

Virtual reality Presentation
Virtual reality PresentationVirtual reality Presentation
Virtual reality Presentation
 
Google cardbord
Google cardbordGoogle cardbord
Google cardbord
 
VIRTUAL REALITY & AUGMENTED REALITY
VIRTUAL REALITY & AUGMENTED REALITY VIRTUAL REALITY & AUGMENTED REALITY
VIRTUAL REALITY & AUGMENTED REALITY
 
Google cardboard presentation
Google cardboard presentationGoogle cardboard presentation
Google cardboard presentation
 
Google Cardboard (DIY) with JUMP - Virtual Reality
Google Cardboard (DIY) with JUMP - Virtual RealityGoogle Cardboard (DIY) with JUMP - Virtual Reality
Google Cardboard (DIY) with JUMP - Virtual Reality
 
Introducing virtual reality
Introducing  virtual  realityIntroducing  virtual  reality
Introducing virtual reality
 
Virtual reality report
Virtual reality reportVirtual reality report
Virtual reality report
 
Virtual reality
Virtual realityVirtual reality
Virtual reality
 
Virtual reality
Virtual realityVirtual reality
Virtual reality
 
Introduction to Virtual Reality (VR) for Business - Workshop
Introduction to Virtual Reality (VR) for Business - WorkshopIntroduction to Virtual Reality (VR) for Business - Workshop
Introduction to Virtual Reality (VR) for Business - Workshop
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
Market Based Analysis of Virtual Reality Products - IT Strategy
Market Based Analysis of Virtual Reality Products - IT StrategyMarket Based Analysis of Virtual Reality Products - IT Strategy
Market Based Analysis of Virtual Reality Products - IT Strategy
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
Virtual Reality 2020
Virtual Reality 2020Virtual Reality 2020
Virtual Reality 2020
 
virtual reality ppt
 virtual reality  ppt virtual reality  ppt
virtual reality ppt
 
Designing UI and UX for Interactive Virtual Reality Apps
Designing UI and UX for Interactive Virtual Reality AppsDesigning UI and UX for Interactive Virtual Reality Apps
Designing UI and UX for Interactive Virtual Reality Apps
 
Virtual reality-What you see is what you believe
Virtual reality-What you see is what you believe Virtual reality-What you see is what you believe
Virtual reality-What you see is what you believe
 
Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)
Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)
Handout: 'Future of Augmented & Virtual Reality' (BDPA Cincinnati, Oct 2015)
 
Virtual Reality for Training, Learning, Education and Visualisation
Virtual Reality for Training, Learning, Education and VisualisationVirtual Reality for Training, Learning, Education and Visualisation
Virtual Reality for Training, Learning, Education and Visualisation
 
2016 Virtual Reality Presentation
2016 Virtual Reality Presentation2016 Virtual Reality Presentation
2016 Virtual Reality Presentation
 

Similar to Virtual Reality Application Development on Android using Google Cardboard

Virtual Reality in Android
Virtual Reality in AndroidVirtual Reality in Android
Virtual Reality in AndroidMario Bodemann
 
Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...DevGAMM Conference
 
Dissecting and fixing Vulkan rendering issues in drivers with RenderDoc
Dissecting and fixing Vulkan rendering issues in drivers with RenderDocDissecting and fixing Vulkan rendering issues in drivers with RenderDoc
Dissecting and fixing Vulkan rendering issues in drivers with RenderDocIgalia
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Androidnatdefreitas
 
[1C7] Developing with Oculus
[1C7] Developing with Oculus[1C7] Developing with Oculus
[1C7] Developing with OculusNAVER D2
 
Android RenderScript
Android RenderScriptAndroid RenderScript
Android RenderScriptJungsoo Nam
 
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...Embarcadero Technologies
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGLGlobant
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009sullis
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Codemotion
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Codemotion
 
AGDK tutorial step by step
AGDK tutorial step by stepAGDK tutorial step by step
AGDK tutorial step by stepJungsoo Nam
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldStefano Sanna
 
Springboard & OpenCV
Springboard & OpenCVSpringboard & OpenCV
Springboard & OpenCVCruise Chen
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008Vando Batista
 
Introduction to Android - Mobile Portland
Introduction to Android - Mobile PortlandIntroduction to Android - Mobile Portland
Introduction to Android - Mobile Portlandsullis
 

Similar to Virtual Reality Application Development on Android using Google Cardboard (20)

Virtual Reality in Android
Virtual Reality in AndroidVirtual Reality in Android
Virtual Reality in Android
 
Google VR SDK 101
Google VR SDK 101Google VR SDK 101
Google VR SDK 101
 
Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...
 
Dissecting and fixing Vulkan rendering issues in drivers with RenderDoc
Dissecting and fixing Vulkan rendering issues in drivers with RenderDocDissecting and fixing Vulkan rendering issues in drivers with RenderDoc
Dissecting and fixing Vulkan rendering issues in drivers with RenderDoc
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
[1C7] Developing with Oculus
[1C7] Developing with Oculus[1C7] Developing with Oculus
[1C7] Developing with Oculus
 
Visage fx
Visage fxVisage fx
Visage fx
 
Android RenderScript
Android RenderScriptAndroid RenderScript
Android RenderScript
 
How to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native ActivityHow to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native Activity
 
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
Net core
Net coreNet core
Net core
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
 
AGDK tutorial step by step
AGDK tutorial step by stepAGDK tutorial step by step
AGDK tutorial step by step
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical world
 
Springboard & OpenCV
Springboard & OpenCVSpringboard & OpenCV
Springboard & OpenCV
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
 
Introduction to Android - Mobile Portland
Introduction to Android - Mobile PortlandIntroduction to Android - Mobile Portland
Introduction to Android - Mobile Portland
 

Recently uploaded

Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmDeepika Walanjkar
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
Forming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptForming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptNoman khan
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Communityprachaibot
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...arifengg7
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 

Recently uploaded (20)

Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
Versatile Engineering Construction Firms
Versatile Engineering Construction FirmsVersatile Engineering Construction Firms
Versatile Engineering Construction Firms
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
Forming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptForming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).ppt
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
ASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductosASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductos
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Community
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 

Virtual Reality Application Development on Android using Google Cardboard

  • 1. Coding a VR Application in Android A Practical Guide
  • 4. Contents ❖ Introduction to Google Cardboard SDK for Android ❖ Requirement of separate SDK for VR ? ❖ Getting Started with First Android Application for VR ❖ Setup of coding environment ❖ Overview of code
  • 5. Intro to Google Cardboard SDK ❖ Cardboard SDK for Android enables developers familiar with OpenGL to quickly start creating VR applications. ❖ The toolkit simplifies many common VR development tasks, including: ❖ Lens distortion correction. ❖ Head tracking. ❖ 3D calibration. ❖ Side-by-side rendering. ❖ Stereo geometry configuration. ❖ User input event handling.
  • 6. Setup of Coding Environment ❖ Building the demo app requires: ❖ Android Studio 1.0 or higher ❖ https://developer.android.com/sdk/index.html ❖ Version 19 of the Android SDK ❖ A physical Android device running Android 16 (Jelly Bean) or higher
  • 7. Lets start coding ❖ Main components of Android VR Application ❖ Manifest file ❖ Cardboard Activity ❖ Custom Renderer ❖ Content Model
  • 8. Android Manifest File Need to specify following permissions in manifest file ❖ NFC — Input Mechanism used by cardboard trigger button <uses-permission android:name="android.permission.NFC" /> ❖ Vibration Sensor — Haptic Feedback mechanism for certain events in Application <uses-permission android:name="android.permission.VIBRATE" /> ❖ Read and write to external storage <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> ❖ Specify minimum and target SDK version <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19"/> ❖ Specify the OpenGL ES version that device must support to run the application <uses-feature android:glEsVersion="0x00020000" android:required="true" />
  • 9. Cardboard Activity ❖ Starting point for coding a cardboard app. ❖ Base activity that provides easy integration with Cardboard devices. ❖ Exposes events to interact with Cardboards. ❖ Uses sticky immersive mode, in which the system UI is hidden, and the content takes up the whole screen.
  • 10. Custom Renderer ❖ Custom Renderer for CardboardView ❖ Implements the CardboardView.StereoRenderer interface ❖ Delegates all stereoscopic rendering details to the view ❖ All stereoscopic rendering and distortion correction details are abstracted from the renderer and managed internally by the view ❖ Overrides the following important methods // Prepares OpenGL ES before we draw a frame. // @param headTransform The head transformation in the new frame. @Override public void onNewFrame(HeadTransform headTransform) { // Called when a new frame is about to be drawn. // Any per-frame operations not specific to a single view should happen here. } @Override public void onDrawEye(Eye eye) { // Draw the frames for each eye }
  • 11. Custom Renderer OnDrawEye Function // Draws a frame for an eye. // @param eye The eye to render. Includes all required transformations. @Override public void onDrawEye(Eye eye) { GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); . . . // Apply the eye transformation to the camera. Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0); // Set the position of the light Matrix.multiplyMV(mLightPosInEyeSpace, 0, mView, 0, LIGHT_POS_IN_WORLD_SPACE, 0); // Build the ModelView and ModelViewProjection matrices // for calculating cube position and light. float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR); Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0); Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0); drawCube(); // Draw rest of the scene. . . . }
  • 12. Content for VR - 3D Models ❖ Consists of any 3D model that we want to render in our application ❖ Can be a simple model like a sphere or cube ❖ Can be complex models of house, players etc to create a real 3D scene.
  • 13. Wrap it up and Lets Code !!! 3D Assets Carboard.jar Google Cardboard Android Application Redistributable APK Cardboard SDK Compatible Android Phone + = = Android Code +