2017.
Welcome to VOID AR
VOID AR is devoted to the continuous development of new AR technology in order to fulfill the AR developers with ultimate imaginaries, creativities and more high quality AR contents.
You can learn to use our products from here if you are trying VOID AR for the first time.
ImageTarget Extension Tracking(SLAM)
Part 1. Introduction
When the Image Recognition ( with image marker ) is successful, you can get rid of the marker and track the model using SLAM technology.
Caution: Only works for mobile platform ( Android, iOS ), Cloud Recognition is currently unavailable for this function.
Part 2. Reading Guidelines
This tutorial is mainly to introduce how to process in Unity environment.
We assume that readers have basic experience in app development and unity usage.
For more unity3d usage information, please visit the official website of unity3d documentation.
Part 3. Development Environment
You need to install and prepare your development environment as below before handling the models:
OS
- Windows 7 or higher
- OS X 10.10 or higher
Unity Version
Unity3D Version: 5.2.x - 5.6.x ( 32bit or 64bit ) , 2017.1
We recommends Unity3D 5.4 or above for better renderring quality.
Download: https://unity3d.com/cn/get-unity/download/archive
Unity3D of this tutorial: 5.5.2 ( 64bit )
Part 4. Implementation process
So far this function only works for mobile platform (Android、iOS), we recommend that you would better create a normal Image Recognition content first, and finish the debugging in PC. And then you can switch the MarkerType to “Extension Tracking” and fill in your "App License Key", then build for Android or iOS for effect checking.
This function do not just support Image Recognition (image target), but also the Videoplayback.
The coming part of this tutorial will introduce you with an example of Image Recognition (Single Target). If you are already familiar with this part, please skip to Step 10 and Step 11.
Step 1. Open new Unity project
Open Unity with new project. Fill the Project name with “ImageTarget”, and select the location, and click [ Create project ].
Step 2. Import VOID AR SDK
Select[ Assets ] -> [ Import Package ] -> [ Custom Package... ], import VOID AR SDK.
Select the downloaded SDK file (.unitypackage), and click [ Open ] button.
Click [ Import ] from the prompted window. It takes minutes during the import process.
If there is a prompt window of “API Update Required” interface,please click [ I Made a Backup, Go Ahead! ].
Step 3. Delete Main Camera
When you open the Unity3D, you will see the new scene in default. The new scene has two GameObjects: a Main Camera and a Directional Light. We need to use the ARCamera from SDK, so please delete the default Camera.
Right click the "Main Camera” from the scene, and select [ Delete ].
Step 4. Drag the prefabs “ARCamera” and “ImageTarget”
Expand the directory [ Assets ] -> [ VoidAR ] -> [ Prefabs ], and drag the prefabs “ARCamera” and “ImageTarget” to the scene.
When you finish the process, it shows as below:
Step 5. ARCamera Setup
Select ARCamera, and look up in the “Inspector” area on the right side, setup “Void AR Behaviour (Script)” properties.
- Set MarkerType = "Image", stands for image target recognition
- Set Simultaneous Tracking = "1", stands for the tracking marker number is 1 at the same time
Step 6. Marker Setup
Select ImageTarget, look up the “Inspector” area on the right side, setup the “Image Target Behaviour (Script)” properties.
- Set Image File Path = "1yuan.jpg", the format is “filename”+“Suffix JPG”
Caution: Marker files must locate in [ Assets ] -> [ StreamingAssets ] folder. This tutorial uses the built-in marker file in SDK.
Step 7. Model Setup
You need to have your model for recognition under the ImageTarget.
Right click the “ImageTarget” in the scene, add a 3D model “Cube”.
Select the “Cube”, adjust its size and position.
Step 8. Save Scene
Select [ File] -> [ Save Scenes ] , click for saving your setup.
Setup the name as “ImageTarget”, and click [ save ] button.
Step 9. Debug
Make sure your PC is connected with a camera, and click [ Play ] button.
Recognize successfully and complete debugging.
Step 10. MarkerType Setup
Select ARCamera, look up the “Inspector” area, set the MarkerType = "Extension Tracking"。
After that, you will need to fill in with your “App License Key”。
Open the website of Cloud platform to register an account, and login.
Website Url:http://cloud.voidar.net
Go to the Cloud plaform, and click [ Create SLAM application ].
Click [ Create application ].
Fill in the AppId in the popup window, and click [ Save ].
- Since the AppId is unique, please setup your AppId here, such as "com.VOIDAR.ImageTargetSLAM"
- Caution: Make sure of that your AppId and Bundle Identifier must be the same, otherwise the SLAM won't work properly. [★★★Very Important★★★]
After that, you will get your “AppKey”.
Back to Unity, select ARCamera, and check the Inspector on the right side, and continue with the setup of “App License Key”.
ImageTarget Extension Tracking(SLAM) only works for Android and iOS, we will introduce the build process in next step.
Step 11. Build for Android or iOS
Build Process includes Android and iOS.
- Android
First, switch the PC platform to Android platform from [ File ] -> [ Build Settings... ].
Select Android tag, if the [ Switch Platform ] button is grey, you need to download the Unity Android Support. Please click on the right side of the [ Open Download Page ] button, download and install.
Click [ Switch Platform ] button, switch the platform to Android.
After switch process, close the Build Settings interface first, and continue with packing.
Select [ Edit ] -> [ Preferences... ], setup the preferences parameters.
Select “External Tools” option, setup Android SDK and JDK。
If you do not have SDK and JDK, please click [ Download ] from the interface, it will guide you to download from the prompted website.
Or you can also download from links below:
SDK: https://developer.android.com/studio/index.html#Other
JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
After the installation of SDK and JDK, you are able to setup their directory.
Select ARCamera, and look up in the “Inspector” area on the right side, setup “Void AR Behaviour (Script)” properties.
- Set Camera = "后置摄像头"(Rear camera)
Select [ File ] -> [ Build Settings... ], cancel all defalt scenes, and click [ Add Open Scenes ] button to add current scene into the build area.
It shows as below:
Click [ Player Settings... ] button, check the “Inspector” area, setup the parameters as below or as your needs.
- Set Company = "VOIDAR"
- Set Product Name = "ImageTarget"
- Set Bundle Identifier = "com.VOIDAR.ImageTargetSLAM" ( The Bundle Identifier must be as same as the AppId you setup in Step 10, otherwise the SLAM won't work properly ) [★★★Very Important★★★]
Caution: Bundle Identifier cannot use default, otherwise it fail to build.
Finish the settings, and click [ Build ] button.
Set the file name as “ImageTarget”, and click [ save ] button to start building.
It takes minutes while building, please wait...
When the build is done, it will generate an apk file “ImageTarget.apk”. Android Build is completed.
- iOS
iOS Build requires Mac device ( such as MacBook Pro、MacBook、iMac、Mac mini etc. )
Switch the platform to iOS platform in Unity, and build Xcode project.
Caution: It is recommended to use Mac device to build Xcode project. If previously you make the project in Windows environment, you can copy the whole Unity directory of this project to Mac device and build for xcode project.
Lauch Unity and open the saved or copied ImageTarget project. ( Skip this step if project opened already )
Click [ Open ] button to open the project.
Switch to iOS platform in Unity, click [ File ] -> [ Build Settings... ].
Select iOS tag, if the [ Switch Platform ] button is grey, you need to download the Unity iOS Support. Please click on the right side of the [ Open Download Page ] button, download and install.
Click [ Switch Platform ] button, switch the platform to iOS.
Close the Build Settings interface after switch.
Select ARCamera, check the “Inspector” area on the right side, setup the "Void AR Behaviour (Script)” properties.
- Set Camera = "后置摄像头"(Rear Camera)
Select [ File ] -> [ Build Settings... ], cancel all defalt scenes, and click [ Add Open Scenes ] button to add current scene into the build area.
It shows as below:
Finish the settings, and click [ Build ] button.
Set the project folder name “Output”, and click [ Save ].
Open the Xcode project.
Filling in your configurations: your certificate, deployment target
Click [ Unity-iPhone ] on the left side, config the parameters as below or by your customization:
- Display Name = "VOIDAR_Test"
- Bundle Identifier = "com.VOIDAR.ImageTargetSLAM" ( The Bundle Identifier must be as same as the AppId you setup in Step 10, otherwise the SLAM won't work properly ) [★★★Very Important★★★]
- Version = "1.0"
- Build = “1.0”
- Team = “Your Certificate”
- Deployment Target = “8.1”
Select General tag and scroll down, click the "+" in the "Linked Frameworks and Libraries".
Select “Accelerate.framework” from the prompted window, and click [ Add ].
After doing that, you will see “Accelerate.framework” from the list of "Linked Frameworks and Libraries" as below:
Add camera usage privacy.
Select “Info” tag, click the "+" below the "Supported interface orientations". Select “Privacy - Camera Usage Description” in the prompting list.
Select ”Build Settings” tag, set Enable Bitcode = “No”.
Connect iphone or ipad to the Mac device, Click [ Run ].
After building, there will be an application(“VOIDAR_Test”) built into your iphone or ipad.
The iOS build is done.
By here, the ImageTarget Extension Tracking ( SLAM ) process is done.