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

Programming a neural network


The best way to learn something is to do it, so in this section, we will write a simple neural network that we'll then train to perform various tasks. This network will have a set number of layers—input, hidden, and output—but we will allow for a number of neurons to be set in each layer. We will write this code in Unity so that we can use it in Chapter 10Mixing in Mixed Reality.

Note

Writing a neural network is an advanced example, which will require a discussion with math to properly explain. If you feel overwhelmed at any time, you can always open up the finished project and check the final results. Of course, if you have written a neural network earlier, then you may also want to skip this section.

For this example, we will create a new project from the source Unity template, so let's get started by opening Command Prompt:

  1. Create a new folder called ARCore off the root (C:\ on Windows) folder using the following commands:
mkdir ARCore
cd ARCore
  1. This set of commands...