Book Image

Learn ARCore - Fundamentals of Google ARCore

Book Image

Learn ARCore - Fundamentals of Google ARCore

Overview of this book

Are you a mobile developer or web developer who wants to create immersive and cool Augmented Reality apps with the latest Google ARCore platform? If so, this book will help you jump right into developing with ARCore and will help you create a step by step AR app easily. This book will teach you how to implement the core features of ARCore starting from the fundamentals of 3D rendering to more advanced concepts such as lighting, shaders, Machine Learning, and others. We’ll begin with the basics of building a project on three platforms: web, Android, and Unity. Next, we’ll go through the ARCore concepts of motion tracking, environmental understanding, and light estimation. For each core concept, you’ll work on a practical project to use and extend the ARCore feature, from learning the basics of 3D rendering and lighting to exploring more advanced concepts. You’ll write custom shaders to light virtual objects in AR, then build a neural network to recognize the environment and explore even grander applications by using ARCore in mixed reality. At the end of the book, you’ll see how to implement motion tracking and environment learning, create animations and sounds, generate virtual characters, and simulate them on your screen.
Table of Contents (17 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Drawing with OpenGL ES


OpenGL ES or just GLES is the trimmed down mobile version of OpenGL. OpenGL is a low-level and powerful 2D and 3D drawing API similar to DirectX. Since it is a low-level library, it does require significant knowledge of 2D/3D maths. Again, for our purposes, we will avoid most of the nasty math and just modify some of the drawing code to change the way the sample app functions. What we will do is modify the sample app to change the way objects are drawn. Load up Android Studio with the sample project and let's get started:

  1. Scroll down to the bottom of PointCloudRenderer.java and look at the following section of code identified in the following screen excerpt:

PointCloudRenderer.java open on the draw method

  1. Now the code is straightforward, but a lot of what is going on assumes that the developer has a good foundation in 3D maths and graphic rendering. We don't have time to go through every step, but, essentially, all that the code is doing is drawing the identified point...