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

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

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 +