Interactive AR project – Stage 1

This is my second Augmented Reality application, my aim for this project, is to create an interactive app featuring a little dinosaur that has to defeat some creepy monsters by incinerating them with his fire breath.

Stage 1

My first goal was to learn how to move a character through space whilst switching between two different animations: one that played when the character is waiting and another one that played every time the character moves around the space, for this, I also wanted to incorporate a screen joystick to control the character’s movements.

So my first task was to make two separate animations of my 3D rigged model:

I found a great youtube tutorial that had almost everything I needed, it was a bit out of date so I had to look for a secondary source to understand how to use Vuforia plugin nowadays, it is actually easier as it is already included in Unity from version 2017.02 onwards. I managed to replicate the Donald Trump app, it worked! My next step was to use my own 3D model/animations.

In order to create my own project, I had to spend a bit of time understanding how image targets work, one the first things I learned is that Vuforia ranks your images from zero to 5 stars. My first image got zero!!!

After doing a bit of research, I found a very good guide (on Vuforia’s website) and I went from zero to one and finally up to three stars!

It turns out that images with high contrast and non-repetitive patterns make much better targets!

So I used this image as my target image for my project:

I even took the risk of adding a flat terrain for the character to walk on top of it, ant it worked!

Finally, I compiled my project and uploaded it to my phone using an app called Android File Transfer (I had to do this as I was working on a Mac, Windows PCs allow you to connect directly to your android phone).

And this is a video of me testing first stage

From here, I am planning to build a more complex environment for the character to walk on top of, so far I have made some tests but the character just walks through the 3D meshes.

I did a bit of research and found out that apparently all colliders are deactivated by Vuforia’s script. Figuring this out is this project’s stage 2.

Resources

First youtube tutorial:
https://www.youtube.com/watch?v=khavGQ7Dy3c

Vuforia updated content:
https://library.vuforia.com/articles/Training/getting-started-with-vuforia-in-unity.html#about

Vuforia target features
https://library.vuforia.com/articles/Solution/Optimizing-Target-Detection-and-Tracking-Stability.html

Android file transfer
https://www.android.com/filetransfer/

AR animated sculpture

For this project, I planned to create an animated projection of a digital sculpture, my aim was to learn the basic workflow to create an AR application using Unity.

Right from the beginning of my research, I’ve got pretty frustrated by the fact that ARcore, one of the leading apps used to create AR applications, was pretty restrictive regarding mobile devices, basically, I discovered that my phone wasn’t compatible for their content.

I was decided to find a workaround, I saw some references from people that claimed they hacked ARcore to make it work with a broad variety of phones, I also read some articles featuring some of the best AR apps in the market, that is when I started to notice this name: Vuforia.

Later I found a pretty interesting tutorial with this title: “Let’s Make an Augmented Reality App in 6 MINUTES!!!!”, I was intrigued so I followed it. Soon I discovered that making a basic app with Vuforia was pretty straight forward, however, I could not find any reference suggesting that I could play it on my phone, at this point, I decided to give it a go as I was willing to spend 6 minutes to find out if my phone was compatible.

First, I learned that you could install Vuforia into Unity, then I found that the video was from 2017 and a lot of things had changed since then, the biggest improvement was that Vuforia became included inside of Unity form version 2017.02 onwards!

Quick tip:

I always try to avoid working on the latest version of a specific software unless I really need to. Very often you will find that the features you need are already available in previous versions and with the benefit of finding many more tutorials and forum references based on that specific version, I personally find it exhausting trying to keep up with the newest trending thing and usually end up using software that was released at least one year ago.

So I downloaded Unity 2017.02, My first task was to create a 3D animation of a sculpture that I later imported inside of Unity.

Using Vuforia is quite straight forward, first you have to create a free Vuforia account, then, you have to create a license key, this is basically a reference string that links your apps to your Vuforia account. If you follow the tutorial I mentioned, at some point you will need to copy and paste your license string inside your Unity project.

To create an image target, first you have to pick/create an image to be used as your target, for this project, I decided to use the same image I used as texture for the sculpture.

Then you assign that image to a target database.

Finally, you download that database (Unity format), import it to your project and install it by double clicking on the file. Now it will be available for you to activate it.

In the end, it didn’t take me 6 minutes, actually, I spent around 20 minutes as the tutorial was a bit out of date and ended up looking for updated instructions on Vuforias plugin (check the resources at the end of this page) but in the end, it was worth it! I compiled my AR app and transferred it to my android device using the Android File Transfer software (I had to do this as I was working on a Mac, Windows PCs allow you to connect directly to your android phone).

And this is a video of me testing the app.

Now that I understand the basic workflow, I decided to work on a more challenging project exploring character animation and user interaction. I called this project Interactive AR Project

Resources

Unity download archive (previous versions)
https://unity3d.com/get-unity/download/archive

Youtube tutorial:
https://www.youtube.com/watch?v=khavGQ7Dy3c

Vuforia updated content:
https://library.vuforia.com/articles/Training/getting-started-with-vuforia-in-unity.html#about

Vuforia account
https://developer.vuforia.com/vui/auth/register

Android file transfer
https://www.android.com/filetransfer/