display text on an image target using vuforia in unity 3d

Augmenting digital and real life together augmented reality is used. In this tutorial you will learn to display text on an image target or marker using vuforia in unity 3D. The video below will help you for better understanding of this blog.

For better understanding make sure to read the previous blogs i.e. DISPLAY 3D MODEL ON IMAGE TARGET USING VUFORIA IN UNITY3D , and DISPLAY IMAGE ON AN IMAGE TARGET OR MARKER USING VUFORIA.

Create a new unity project:

In augmented reality creating a new unity project requires some of the things to be done. For creating a new unity project you need to write project name and then click on create project.

Creating database

Adding new image:

For adding a new image target you need to go to vuforia engine. After going to vuforia engine click on image and re position it. Now go to vuforia portal. For opening vuforia developer portal make sure that you are sign in. Click on develop and after that go to click on target manager. For adding the target click on single image. Now choose the image by clicking on the browse button, then add certain width and rename it. Then click on add.

Adding target

Scene Setting:

Now we have to set scene for augmented reality. For that you have to delete main camera and add AR camera and image. As you can see this warning sign, go to build settings then go to player settings. Go to the bottom click on XR settings and check the vuforia augmented reality.

Warning sign during scene setting

Downloading the database:

Now download that data base. Click on unity editor then click on download. When it is downloaded drag it to the unity timeline put it in assets. Make sure that all the items are selected and click on import. Go to image target and select your database. Now you can see your image has loaded.

Downloading Database

Adding text on an image target:

Now we need to drag the downloaded in unity. Click on import and go to the image target and name it. Make sure that your image target is selected. Now right click on the image target and go to 3D object select 3D text.

selecting 3D object

Now, I am scaling it as 0.005 with x, y and z axis. Same scale size with all the three axis. Now you can see that Arial font is selected and we can not do changes with Arial. So, we have to select another text. So, go to format. I am selecting Source Sanserif font.

font selection
choosing the font-text

Click on selected font and give it 300 font size and change the character to Unicode and click on apply.

Font size

Now click on apply and then go to New text and add text of your choice and rotate it 90 degrees. After rotating positioning the text.

Positioning the text

Export Application :

From top menu click on file, then click on build settings. Check the platform is android if not switch it. And then click on add open scenes. Now click on player settings. Go to other settings. Change the package name according to your choice. Unchecked x86 and Android TV compatibility. Change the stripping level to low. Click on XR settings and make sure vuforia augmented reality is selected. And then you can insert the icon of your app. That’s all for settings now connect your android mobile with your computer and click on build and run. Now name it and save it.