SlideShare a Scribd company logo
1 of 13
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

Augmented Reality Application Tutorial for Education 2
Augmented  Reality Application Tutorial for Education 2Augmented  Reality Application Tutorial for Education 2
Augmented Reality Application Tutorial for Education 2Isidro Navarro
 
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Codemotion
 
Mobile AR Lecture 5 - Location Based AR
Mobile AR Lecture 5 - Location Based ARMobile AR Lecture 5 - Location Based AR
Mobile AR Lecture 5 - Location Based ARMark Billinghurst
 
Augmented Reality Application Tutorial for Education 1
Augmented  Reality Application Tutorial for Education 1Augmented  Reality Application Tutorial for Education 1
Augmented Reality Application Tutorial for Education 1Isidro Navarro
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesNexusEdgesupport
 
SAE AR/VR - The challenges of creating a VR application with Unity
SAE AR/VR - The challenges of creating a VR application with UnitySAE AR/VR - The challenges of creating a VR application with Unity
SAE AR/VR - The challenges of creating a VR application with UnitySebastien Kuntz
 
Make believe - Droidcon UK 2015
Make believe - Droidcon UK 2015Make believe - Droidcon UK 2015
Make believe - Droidcon UK 2015Shanee Nishry
 
【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介
【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介
【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介Unity Technologies Japan K.K.
 
Mixed reality for Windows 10
Mixed reality for Windows 10Mixed reality for Windows 10
Mixed reality for Windows 10Jiri Danihelka
 
AR Foundation framework: product roadmap – Unite Copenhagen 2019
AR Foundation framework: product roadmap – Unite Copenhagen 2019AR Foundation framework: product roadmap – Unite Copenhagen 2019
AR Foundation framework: product roadmap – Unite Copenhagen 2019Unity Technologies
 
Extended Reality in Game Design
Extended Reality in Game DesignExtended Reality in Game Design
Extended Reality in Game DesignSadia Zafar
 
Cardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesCardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesMark Billinghurst
 
Improving the VR experience - VRST 2012
Improving the VR experience - VRST 2012Improving the VR experience - VRST 2012
Improving the VR experience - VRST 2012Sebastien Kuntz
 
Unity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityUnity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityNexusEdgesupport
 
Synthetic environment
Synthetic environmentSynthetic environment
Synthetic environmentUllas Gupta
 
Developing VR Experiences with Unity
Developing VR Experiences with UnityDeveloping VR Experiences with Unity
Developing VR Experiences with UnityMark Billinghurst
 

What's hot (18)

Augmented Reality Application Tutorial for Education 2
Augmented  Reality Application Tutorial for Education 2Augmented  Reality Application Tutorial for Education 2
Augmented Reality Application Tutorial for Education 2
 
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
 
Mobile AR Lecture 5 - Location Based AR
Mobile AR Lecture 5 - Location Based ARMobile AR Lecture 5 - Location Based AR
Mobile AR Lecture 5 - Location Based AR
 
Augmented Reality Application Tutorial for Education 1
Augmented  Reality Application Tutorial for Education 1Augmented  Reality Application Tutorial for Education 1
Augmented Reality Application Tutorial for Education 1
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All Slides
 
SAE AR/VR - The challenges of creating a VR application with Unity
SAE AR/VR - The challenges of creating a VR application with UnitySAE AR/VR - The challenges of creating a VR application with Unity
SAE AR/VR - The challenges of creating a VR application with Unity
 
Make believe - Droidcon UK 2015
Make believe - Droidcon UK 2015Make believe - Droidcon UK 2015
Make believe - Droidcon UK 2015
 
【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介
【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介
【Unite 2017 Tokyo】「日本列島VR」および「HoleLenz」の開発事例ご紹介
 
Mixed reality for Windows 10
Mixed reality for Windows 10Mixed reality for Windows 10
Mixed reality for Windows 10
 
AR Foundation framework: product roadmap – Unite Copenhagen 2019
AR Foundation framework: product roadmap – Unite Copenhagen 2019AR Foundation framework: product roadmap – Unite Copenhagen 2019
AR Foundation framework: product roadmap – Unite Copenhagen 2019
 
Extended Reality in Game Design
Extended Reality in Game DesignExtended Reality in Game Design
Extended Reality in Game Design
 
Game Development in VR
Game Development in VR Game Development in VR
Game Development in VR
 
Cardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesCardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR Experiences
 
Improving the VR experience - VRST 2012
Improving the VR experience - VRST 2012Improving the VR experience - VRST 2012
Improving the VR experience - VRST 2012
 
Unity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityUnity - Essentials of Programming in Unity
Unity - Essentials of Programming in Unity
 
Synthetic environment
Synthetic environmentSynthetic environment
Synthetic environment
 
Google daydream
Google daydreamGoogle daydream
Google daydream
 
Developing VR Experiences with Unity
Developing VR Experiences with UnityDeveloping VR Experiences with Unity
Developing VR Experiences with Unity
 

Viewers also liked

A virtual reality applications gallery
A virtual reality applications galleryA virtual reality applications gallery
A virtual reality applications galleryKhaled Ali
 
Education and Virtual Reality - Reimagining education with VR
Education and Virtual Reality - Reimagining education with VREducation and Virtual Reality - Reimagining education with VR
Education and Virtual Reality - Reimagining education with VRMichael Jensen
 
VR & Education: Collaboration-vs-Simulation
VR & Education: Collaboration-vs-SimulationVR & Education: Collaboration-vs-Simulation
VR & Education: Collaboration-vs-SimulationDenis Hurley
 
Virtual Reality In Architecture
Virtual Reality In ArchitectureVirtual Reality In Architecture
Virtual Reality In Architectureengineering59
 
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...Banyapon Poolsawas
 
Virtual reality Presentation
Virtual reality PresentationVirtual reality Presentation
Virtual reality PresentationAnand Akshay
 
VR in Education: How Virtual Reality Can Impact Learning
VR in Education: How Virtual Reality Can Impact LearningVR in Education: How Virtual Reality Can Impact Learning
VR in Education: How Virtual Reality Can Impact LearningHugh Seaton
 
Final presentation of virtual reality by monil
Final presentation of virtual reality by monilFinal presentation of virtual reality by monil
Final presentation of virtual reality by monilritik456
 
The Emerging Virtual Reality Landscape: a Primer
The Emerging Virtual Reality Landscape: a PrimerThe Emerging Virtual Reality Landscape: a Primer
The Emerging Virtual Reality Landscape: a PrimerSim Blaustein
 
Virtual Reality-Seminar presentation
Virtual Reality-Seminar  presentationVirtual Reality-Seminar  presentation
Virtual Reality-Seminar presentationShreyansh Vijay Singh
 

Viewers also liked (16)

A virtual reality applications gallery
A virtual reality applications galleryA virtual reality applications gallery
A virtual reality applications gallery
 
Education and Virtual Reality - Reimagining education with VR
Education and Virtual Reality - Reimagining education with VREducation and Virtual Reality - Reimagining education with VR
Education and Virtual Reality - Reimagining education with VR
 
Virtual reality
Virtual realityVirtual reality
Virtual reality
 
User involvement in design and application of virtual reality gamification to...
User involvement in design and application of virtual reality gamification to...User involvement in design and application of virtual reality gamification to...
User involvement in design and application of virtual reality gamification to...
 
VR & Education: Collaboration-vs-Simulation
VR & Education: Collaboration-vs-SimulationVR & Education: Collaboration-vs-Simulation
VR & Education: Collaboration-vs-Simulation
 
Virtual Reality In Architecture
Virtual Reality In ArchitectureVirtual Reality In Architecture
Virtual Reality In Architecture
 
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
 
Virtual reality
Virtual realityVirtual reality
Virtual reality
 
Virtual reality Presentation
Virtual reality PresentationVirtual reality Presentation
Virtual reality Presentation
 
VR in Education: How Virtual Reality Can Impact Learning
VR in Education: How Virtual Reality Can Impact LearningVR in Education: How Virtual Reality Can Impact Learning
VR in Education: How Virtual Reality Can Impact Learning
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
Final presentation of virtual reality by monil
Final presentation of virtual reality by monilFinal presentation of virtual reality by monil
Final presentation of virtual reality by monil
 
The Emerging Virtual Reality Landscape: a Primer
The Emerging Virtual Reality Landscape: a PrimerThe Emerging Virtual Reality Landscape: a Primer
The Emerging Virtual Reality Landscape: a Primer
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
Virtual Reality-Seminar presentation
Virtual Reality-Seminar  presentationVirtual Reality-Seminar  presentation
Virtual Reality-Seminar presentation
 

Similar to Developing Virtual Reality Application 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 Developing Virtual Reality Application 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

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Developing Virtual Reality Application 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 +