Book Image

Unity 2018 Augmented Reality Projects

By : Jesse Glover
Book Image

Unity 2018 Augmented Reality Projects

By: Jesse Glover

Overview of this book

Augmented Reality allows for radical innovations in countless areas. It magically blends the physical and virtual worlds, bringing applications from a screen into your hands. Meanwhile, Unity has now become the leading platform to develop augmented reality experiences, as it provides a great pipeline for working with 3D assets. Using a practical and project-based approach, Unity 2018 Augmented Reality Projects educates you about the specifics of augmented reality development in Unity 2018. This book teaches you how to use Unity in order to develop AR applications which can be experienced with devices such as HoloLens and Daydream. You will learn to integrate, animate, and overlay 3D objects on your camera feed, before gradually moving on to implementing sensor-based AR applications. In addition to this, you will explore the technical considerations that are especially important and possibly unique to AR. The projects in the book demonstrate how you can build a variety of AR experiences, whilst also giving insights into C# programming as well as the Unity 3D game engine via the interactive Unity Editor. By the end of the book, you will be equipped to develop rich, interactive augmented reality experiences for a range of AR devices and platforms using Unity.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
Packt Upsell


Welcome to Unity 2018 Augmented Reality Projects. This book is designed for programmers looking to step out of their comfort zones and take the leap into learning about Augmented Reality (AR) and how to create projects within Unity with it. We will focus on Android, iOS, and Windows devices and dive deep into understanding the fundamentals of getting started with this amazing and ever-growing technology.

Who this book is for

This book is for anyone looking to expand their current knowledge of Unity. They should have some experience with C# and Unity and should be willing to expose themselves to a little C++, Java, and Objective-C language code as well.

What this book covers

Chapter 1, What AR is and How to Get Set Up, explains the processes of installing various SDKs and packages for enabling AR, and building a Hello World example with AR.

Chapter 2, GIS Fundamentals - The Power of Mapping, explores the history of GIS, GIS implications in applications and games, and GIS in education.

Chapter 3, Censored - Various Sensor Data and Plugins, looks at how to write plugins for Unity in C#, how to write plugins for Unity in C++, how to write plugins for Unity in Objective-C, and how to write plugins for Unity in Java.

Chapter 4, The Sound of Flowery Prose, goes into details of the steps for designing an application, looks at conceptualizing the project, and explores how to create an AR application based on the perception of sound.

Chapter 5, Picture Puzzle - The AR Experience, helps you design an educational app, learn to use Vuforia, and develop an educational AR application with Vuforia.

Chapter 6, Fitness for Fun - Tourism and Random Walking, teaches about Mapbox, integrating Mapbox into Unity, and building a random walk-to-location app prototype.

Chapter 7, Snap it! Adding Filters to Pictures, helps you learn about OpenCV, incorporate OpenCV into Unity, build OpenCV from source, and build a facial detection app prototype with OpenCV.

Chapter 8, To the HoloLens and Beyond, gives you an insight into the difference between AR andMixed Reality(MR), teaches you how to use the Hololens simulator, and gets you to build a basic prototype for MR using the Hololens simulator.

To get the most out of this book

To get the most out of this book, you should have some knowledge of the Unity Editor, UI, and build processes. In addition to this, it is highly advised that you have some skill with C# that is above the beginners' level, as this book does not go into how to write C# code. Lastly, it is suggested that you should have, at the very least, taken a look at other programming languages, such as Swift, Objective-C, C, C++, and Java, and are able to get the gist of what is happening with the code that you will encounter in this book at a glance.

The only requirements are basic knowledge of the Unity Game Engine and C#, as they are the primary focuses of this book.

Download the example code files

You can download the example code files for this book from your account at If you purchased this book elsewhere, you can visit and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here:

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Create a brand new Unity Project. I will call mine Snap."

A block of code is set as follows:

struct Circle
Circle(int x, int y, int radius) : X(x), Y(y), Radius(radius) {}
int X, Y, Radius;

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

extern "C" void __declspec(dllexport) __stdcall  Close()

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."


Warnings or important notes appear like this.


Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected] and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit


Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit