Loading...

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.

VOID SLAM(Markerless)

The Foreword ( ★★★Very Important★★★ )

- Build Prerequisite 

VOID SLAM is a multiple fusion technology independently developed by VOID AR, which requires the IMU. Due to the IMU is not available in PC, we cannot test VOID SLAM in PC, therefore we need to build it to Mobile platform ( Android or iOS ) for getting effect experience.

- Attaching to Ground-surface

When using the VOID SLAM technology, please be sure to make the bottom of the model as closed to the ground as possible in order to get better experience of VOID SLAM presentation.

Please read CAREFULLY from [Part 4. Implementation process] -> [Step 8. Make the bottom of the model closed to the ground for better SLAM experience ] in this tutorial. 

Comparison between closed to ground and non-closed to ground:

102.png

Examples in GIF:


Part 1. Introduction

VOID SLAM technology, without the markers, you can freely place virtual content in the real environment to experience AR effect.

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

Step 1. Open new Unity project

Open Unity with new project. Fill the Project name with “VOID SLAM”, and select the location, and click [ Create project ].

1.png

Step 2. Import VOID AR SDK

Select[ Assets ] -> [ Import Package ] -> [ Custom Package... ], import VOID AR SDK.

2.png

Select the downloaded SDK file (.unitypackage), and click [ Open ] button.

103.png


Click [ Import ] from the prompted window. It takes minutes during the import process.

104.png

If there is a prompt window of “API Update Required” interface,please click [ I Made a Backup, Go Ahead! ].

5.png

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 ].

6.png

Step 4. Drag the prefabs “ARCamera”

Expand the directory [ Assets ] -> [ VoidAR ] -> [ Prefabs ], and drag the prefabs “ARCamera” to the scene.

7.png

When you finish the process, it shows as below:

8.png

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 = "Markerless"

105.png

Step 6. Set Access Key and Secret Key

Open the website of Cloud platform to register an account, and login.

Website Url:http://cloud.voidar.net

126.png

Go to the Cloud plaform, and click [ Create SLAM application ].

127.png

Click [ Create application ].

128.png

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.SLAM"

- Caution: Make sure of that your AppId and Bundle Identifier must be the same, otherwise the SLAM won't work properly. [★★★Very Important★★★]

129.png

After that, you will get your “AppKey”.

130.png

Back to Unity, select ARCamera, and check the Inspector on the right side, and continue with the setup of “App License Key”.

111.png

Step 7. Add a model

Right click the scene, select [ Create Empty ] from pop menu.

50.png

Create a  "GameObject".

51.png

Select the “GameObject”, and adjust its position to (0,0,0).

52.png

Right click the “GameObject”, select “3D Object” from pop menu, and click [ Cube ].

53.png

Then you create a 3D model "Cube" under the GameObject.

54.png

In order to present a suitable size of the model, select the “Cube” and adjust its size and position.

Position =(X , Y , Z = 0 , 0 , 0)

Scale=(X , Y , Z = 0.3 , 0.3 , 0.3)

55.png

Step 8. Make the bottom of the model closed to the ground for better SLAM experience. [★★★Very Important★★★]

When using the VOID SLAM technology, please be sure to make the bottom of the model as closed to the ground as possible in order to get better experience of VOID SLAM presentation.

There are 2 way for making the bottom of the model closed to the ground:

1.Adjust the center of the model

Using 3d max or some other software to change the center of the model to bottom of the model. We will not introduce more details here. Please go to “Change the center of the model” for reference.

2.Add a reference ground plane, and adjust the model's position in Unity3D.

Usually the center of the model created in Unity3D is locating on the middle center of the model. You can create a reference plane, and adjust the model’s bottom surface next to the plane surface.
Please follow the instructions below:

The new created “Cube” model’s center is just in the middle center of this object. If you want to get a better ground effect from VOID SLAM, you need to place the bottom surface of the model closed to the ground.

Create a Plane for reference. Right click the scene, and select “3D Object” from pop menu, and then click [ Plane ].

56.png

Select the “Plane”, and adjust its position to (0,0,0).

57.png

Select the 3D model “Cube”, drag its coordinate to adjust its positon to make its bottom surface close to the Plane.(X , Y , Z = 0 , 0.15 , 0)

58.png

Make the bottom surface of the object closed to the Plane.

Right click the “Plane”, click [Delete] to delete the reference Plane, the adjust is done.

59.png

Step 9. Trigger Setup

First select “ARCamera”, then hold the mouse left button on “GameObject” and drag it to the parameter of “MakerlessNode”.

116.png

After setup, it shows as below:

117.png

Select “GameObject”, click [ Add Component ] to add “Markerless Tracking“ script component.

125.png

After binding, it shows as below:

118.png

Next, you need to creat a script to realize the function of markerless tracking.

Create a folder under the directory of Assets.

63.png

Change its folder name to be “Scripts”.

64.png

Right click the folder “Scripts”, and create a new C# script.

65.png

Set the script name to "SLAM".

66.png

Double click “SLAM” script, copy and paste the following codes into the script and then save it.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
   
    public class SLAM : MonoBehaviour {
   
        void OnGUI()
        {
            var btnHeight = Screen.height * 0.1f;
            var btnWidth = btnHeight * 3.0f;
            var gap = 20;
            GUI.skin.button.fontSize = 36;
            if (GUI.Button(new Rect(Screen.width - btnWidth, gap, btnWidth, btnHeight), "Start"))
            {
                VoidAR.GetInstance().startMarkerlessTracking();//Start Tracking
            }
   
            if (GUI.Button(new Rect(Screen.width - btnWidth, gap * 2 + btnHeight, btnWidth, btnHeight), "Reset"))
            {
                VoidAR.GetInstance().resetMarkerless();//Reset Markerless
            }
         }
    }

Select “ARCamera”, click [ Add Component ], and add the “SLAM” script.

119.png

After binding, it shows as below:

120.png

Step 10. Save Scene

Select [ File] -> [ Save Scenes ] , click for saving your setup.

14.png

Setup the name as “VOID SLAM”, and click [ save ] button.

121.png

Step 11. Build for Android or iOS

VOID SLAM is a multiple fusion technology independently developed by VOID AR, which requires the IMU.

Due to the IMU is not available in PC, we cannot test VOID SLAM in PC, therefore we need to build it to Mobile platform ( Android or iOS ) for getting effect experience.

Build Process includes Android and iOS.

- Android

First, switch the PC platform to Android platform from [ File ] -> [ Build Settings... ].

18.png

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.

19.png

Click [ Switch Platform ] button, switch the platform to Android.

20.png

After switch process, close the Build Settings interface first, and continue with packing.

Select [ Edit ] -> [ Preferences... ], setup the preferences parameters.

47.png

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.

48.png

Select ARCamera, and look up in the “Inspector” area on the right side, setup “Void AR Behaviour (Script)” properties.

- Set Camera = "后置摄像头"(Rear camera)

122.png

Select [ File ] -> [ Build Settings... ], cancel all defalt scenes, and click [ Add Open Scenes ] button to add current scene into the build area.

21.png

It shows as below:

22.png

Click [ Player Settings... ] button, check the “Inspector” area, setup the parameters as below or as your needs.

- Set Company = "VOIDAR"

- Set Product Name = "VOID SLAM"

- Set Bundle Identifier = "com.VOIDAR.SLAM" ( The Bundle Identifier must be as same as the AppId you setup in Step 6, otherwise the SLAM won't work properly ) [★★★Very Important★★★]

Caution: Bundle Identifier cannot use default, otherwise it fail to build.

23.png

Finish the settings, and click [ Build ] button.

24.png

Set the file name as “VOID SLAM”, and click [ save ] button to start building.

25.png

It takes minutes while building, please wait...

26.png

When the build is done, it will generate an apk file “VOID SLAM.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 VOID SLAM project. ( Skip this step if project opened already )

28.png

Click [ Open ] button to open the project.

29.png

Switch to iOS platform in Unity, click [ File ] -> [ Build Settings... ].

30.png

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.

31.png

Click [ Switch Platform ] button, switch the platform to iOS.

32.png

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)

123.png

Select [ File ] -> [ Build Settings... ], cancel all defalt scenes, and click [ Add Open Scenes ] button to add current scene into the build area.

34.png

It shows as below:

35.png

Finish the settings, and click [ Build ] button.

36.png

Set the project folder name “Output”, and click [ Save ].

 37.png

Open the Xcode project.

38.png

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.SLAM" ( The Bundle Identifier must be as same as the AppId you setup in Step 6, otherwise the SLAM won't work properly ) [★★★Very Important★★★]

- Version = "1.0"

- Build = “1.0”

- Team = “Your Certificate”

- Deployment Target = “8.1”

124.png

Select General tag and scroll down, click the "+" in the "Linked Frameworks and Libraries".

40.png

Select “Accelerate.framework” from the prompted window, and click [ Add ].

41.png

After doing that, you will see “Accelerate.framework” from the list of "Linked Frameworks and Libraries" as below:

42.png

Add camera usage privacy.

Select “Info” tag, click the "+" below the "Supported interface orientations". Select “Privacy - Camera Usage Description” in the prompting list.

43.png

44.png

Select ”Build Settings” tag, set Enable Bitcode = “No”.

45.png

Connect iphone or ipad to the Mac device, Click [ Run ].

46.png

After building, there will be an application(“VOIDAR_Test”) built into your iphone or ipad.

The iOS build is done.

Part 5. Procedure of Use

Start: Lauch the VOID SLAM ( Markerless ), initialize the virtual objects ( For better experience and performace, please face the camera close to a flat surface with full of features).

Reset: Reset the VOID SLAM ( Markerless ), remove the virtual objects and stop tracking.

If you need to change another environment or surface when you have already generated the virtual object by clicking [ Start ], please click [ Reset ] first and then click [ Start ].

Surface Requirements:

1. Full of features
2. Close to surface

Examples:

70.png


By here, VOID SLAM ( Markerless ) process is done.