As the first round of AR development tutorial, xiaobian today brings you to use personal ID card to easily implement the small functions of augmented reality. This time xiaobian first use HIAR to do, the reason is very simple, the development of AR video function of personal feel much simpler than Vuforia, good nonsense do not say, start!

Step 1: Log in HiAR official website (http://hiar.com.cn/), enter the management background after simple registration, click SDK to download and create an application




After you create an application and fill in the information, the following information will appear:




AppKey and Secret reserve meetings will be used

Step 2: Create an atlas (the picture we choose is taken on the back of the ID card downloaded from the website)







Then associate the newly created application




Step 3: Download the atlas package and import the SDK into Unity in turn







Step 4: Import video resources and gradually realize AR video augmented reality

Create a Unity project and import the SDK

Create HiARCamera

Set AppKey and Secret

Create ImageTarget

Create a New Unity project

Then drag the HiARCamera in Assets/ hiar-Unity /Prefabs to the Hierarchy window.




Drag the VideoPlayer from Assets/ hiar-Unity /Prefabs to the Hierarchy window and set it as a child of ImageTarget.




Set AppKey and Secret




Add ImageTarget




Import the video file (note: Place the video file (video.mp4 as an example in this article) in the StreamingAssets root directory.)

Video AR production (Drag the VideoPlayer in Assets/ hiar-Unity /Prefabs to the Hierarchy window and set it as a child item of ImageTarget. Select VideoPlayer in the Hierarchy window and find the VideoPlayer Mono Behaviour in the corresponding Inspector window. Then select Video.mp4 from the Video File option.)







The last step: debug run, after the above operation is complete, you need to run in Unity to see the effect. Make sure you have a camera installed on your computer before running it.

Add-on: Simple and easy to learn AR demo like this is very easy to use, you can also pretend in front of friends, such as make a self-introduction video, with everyone’s ID card to identify, let others to know yourself, isn’t it cool. Other application scenarios are left to your imagination.