Introductory tutorial using Augmented Reality in Unity3d version 5, deployed to Android using the Vuforia API. Included are simple steps to activate Augmented Reality in Unity3d version 5 and Vuforia for deployment to android; Working with basic image targets.
5. Creating AR Camera
• Drag an ARCamera Prefab
into the Hierarchy
• Remove the Main Camera
from the Hierarchy
• Click the ARCamera and
view the inspector window
6. Obtaining a License Key
1. Developer Account – Please read
this guide
2. Go to License Manager and click
Add License button
3. Name your Application
4. Choose Device (mobile)
5. Choose a licensing option (starter)
6. Click Next
7. Confirm to Agreement
8. Click You Application Name in the
License Manger List
7. Vuforia Behaviour Script
• Copy your License Key to the Vuforia
Behaviour Script App License Key – In
Unity 3D
• If using Android I recommend switching
the Camera Device Mode to
MODE_OPTIMIZE_SPEED If using IOS I
recommend MODE_OPTIMIZE_QUALITY
• For now I will leave Tracked Images at 1
but if you want to track multiple images
you will need to modify this number
• Leave the rest as Default
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
8. Test License and AR Camera
• First Test your AR Camera and
License Key
• To do this on Android go File
Build Settings
• Then select Android and Switch
Platform
• For more details on how to
setup Android with Unity3d
please checkout this guide (pg
15)
• Plug in your Android Device to
the USB port of your computer
• Click Player Settings
9. Android Player Settings
• Name your Company
• Give your Product a Name
• You can put an Icon in the Default
Icon
• Under Identification add your
Company and Product Name to the
Bundle Identifier
• Now Click Build and Run
• Name your APK file
• Click SAVE
• You Should see a pass through
camera appear on your Android
Device with a Vuforia Watermark
10. Target Manager
• You now need to add a Device Database to
your project
• In the Vuforia Developer Portal Click Target
Manager and Add Database
• Name your Database and select Device
• Click Create
• Click on your newly created Database
• You will notice your Target Database is
empty you will now need to populate your
Target Database with AR Markers
• Click Add Target
11. Creating Target Database
• There are many types of targets for now
we are only creating a 2D Single Image
for Recognition for more details check
out the Vuforia Getting Started Guide
• Click Single Image
• Choose a picture to convert to an AR
marker for more details on how to
choose a good image check this guide
• Width – Leave as 1
• Click Add
1
12. Image Quality
• You can see the image I
added is not a great marker
scoring only 2 stars
• It will still work in the
simulation but will be prone
to error
• I recommend a 5 star marker
for the best accuracy
• If you click on the target
name you can view the
features
13. Adding Target Database
• Select All Targets
• And Click Download Database
• Select Unity Editor and Download
• This will form a Unity import package that you can then open and import to Unity3d
15. Add AR assets and prefabs to scene
• Drag an instance of the ImageTarget prefab into
your scene. This represents a single instance of an
Image Target object
• Select the ImageTarget in your Hierarchy and look
at the inspector
• Look at the Image Target Behaviour script
• Under Database select your downloaded database
and under image target select your image from the
database for now I will leave extended tracking off
if you want to know more about extended tracking
and persistent tracking check out this guide
16. Add 3d object to scene
and attach to trackable
• As a test create a simple cube object
• Add the cube as a child of the
ImageTarget object in the Hierarchy
• Move the cube in the scene until its
centered on the Image Target you
may need to scale the cube
• On the ARCamera Inspector expand
the Database Load Behaviour Script
and Load your downloaded Database
• Activate the database
17. Deploy the application
• Build out your application
• You should have a high quality
printout of the appropriate Image
Target infront of you. If not just test
with a digital version on your screen
• When you look at the target using the
device camera you should see the
cube bound to the image