3D Augmented Reality Object
This was my first attempt in creating a 3D object for Augmented Reality using Vuforia and Unity. It’s unfortunate that Unity has made it so task-heavy and presenting their complex software for beginners…I come from a development background (since Flash Actionscript 2.0) and felt that Unity needs more work on enabling the beginner to present their UI with more simplicity rather than overwhelming their users. This can have a negative effect for potential designers and companies wishing to leverage AR technology. Hopefully, some of our comments could advise Unity to take a second look at their UI to allow more simple processes in producing AR for the every day user for various backgrounds…yes, even children.
How to set up Vuforia and Unity to create an AR object
It was a difficult task setting up the software, license, assets, etc. simply to make a 3D object for AR. Too many buttons, too many steps and too many switching views from the Vuforia website and the Unity software. If you only want to show a simple 3D object via AR without any C# scripting, follow these steps below:
I. DOWNLOAD THE UNITY SOFTWARE (free)
II. GO TO Vuforia.com
A. Create an “Developer Account” with Vuforia (free)
B. Go to “License Manager” and create a “Development License Key”
1. add an app name
2. click on the license key you created
3. copy the “License Key”
C. Select “Target Manger” under the “Development” tab on Vuforia.com
1. Select “Add Database”
2. Create a name
3. select “Device” (not “Cloud” or “VuMark”)
4. Select “Create”. This will create a database
5. Select the database name you just created.
6. Select “Add Target” which you will create your images to be targeted in AR
7. A pop-up will expose allowing 4 types of “Image Types”
8. Select “Single Image” (for the simplicity of setting up)
9. Browse for the image you would like Unity to target
10. Provide the “Width” which should be “1” (representing centimeters)
11. The “Name” field should be automatically named
12. Select “Add”
13. The image will be presented and rated on how well the AR will track the image. Its best to use images which are basic and not detailed so much like a photograph. It is possible however it is dependable upon the lighting, reflection, color contrast, etc. Try to stay between 3-5 stars.
14. You can upload as many images as you want to track in each database
15. Select “Download Database”
16. A pop-up will be exposed.
17. Select the “Unity Editor” radio button, then download to your computer
III. RETURN TO UNITY
A. Delete “main camera” in the Hierarchy panel
B. right-click on the Hierarchy panel
1. Select “Vuforia”, then select “AR Camera”
2. (on pop-up) Select “Import Vuforia Assets” which is required
C. Select “Edit”, then “Project Settings”, then “Player”
D. Go to Inspector Panel. “Player Settings” should be visible
1. Scroll down to “XR Settings”
2. Select the check box “Vuforia Augmented Reality”
3. Close “XR Settings”
4. Select “Other Settings”
5. Under “Package Name”, enter your company name to build for device.
E. Select “AR Camera” on the Hierarchy panel
1. Be sure that there are no more warnings in the “Inspector Panel”
2. Click “Open Vuforia Configuration” button at the bottom of the Inspector Panel.
3. Close to the top, you will see “App License Key”
4. From “Step II.” (above), paste your Vuforia License Key in the field provided.
5. Check in the “Project” panel to see that “VuforiaConfiguration” package is visible.
6. Drag your “Database” to the “Project” panel (the one you created image targets and downloaded to your computer)
7. Import everything from the file you just dragged into Unity
IV. SET UP THE TARGET
A. Go to the “Hierarchy” panel and right-click inside.
1. Select “Vuforia”, then select “Image”
B. Select “ImageTarget” in the Hierarchy panel (which you just imported)
1. Go to the “Inspector” panel.
2. Select the “Database” dropdown and select the name of the database (which you created on Vuforia, downloaded to your computer and now just dragged into your “Hierarchy” panel)
3. The “ImageTarget” name should already be visible beneath the “Database” name you created
C. Select “ARCamera” inside the Hierarchy panel
D. Look at the Inspector panel.
1. Select the “Open Vuforia Configuration” button
2. Look under “Datasets”
a. Select the “Load (your_database_name) Database”
b. Select “Activate” (which will populate after above selection)
c. Uncheck the other “Images” Object” and VuMark” in the “Datasets” section
V. BACK AT THE UNITY HIERARCHY PANEL…
A. Right-click onto “ImageTarget”
1. Select “3D Object”, then select “Cube” or any other 3D object in this selection
B. Scale and reposition on how you would like to display the object
C. Test your AR object by selecting the “Play” icon at the top.
*** NOTE FOR MAC ***
IF your software is having issues with your camera, you may need to locate the .xml file.
A. For MAC: Find the file “HD > Applications > Unity > PlaybackEngines > VuforiaSupport > VuforiaResources > webcamprofiles.xml
1. Scroll down to the bottom of this file (around line 224)
2. If it is a locked file, you may need to duplicate the file. If so, rename the original file to something else. Then you would need to rename the edited version to the original name.
3. Change “<webcam deviceName=”FaceTime HD Camera (Built-in)“>” to “<webcam deviceName=”FaceTime HD Camera”>
4. Or just simply remove “(Built-in)” from the line above