Testing the app

When developing a project in Unity, it's good practice to test it before building it since the building process takes time. This way, you can detect basic problems and errors and correct them quickly before actually trying the app on your phone.

Vuforia can't currently be built as a standalone application, but it has a script integrated with the ARCamera for testing purposes. When you are testing the app in Unity editor, it will use the computer's camera to simulate the AR. If it doesn't detect a camera, it will leave the background black and play the AR directly.

On the other hand, when you're working with a Ground Plane project and you want to test the app, Vuforia won't be able to use the device's sensors to detect a flat surface. Instead, it offers an image target reference to simulate Ground Plane recognition, and when the camera detects that image, it will behave like it's detecting a flat surface on the phone.

To test our app, follow these steps:

  1. Locate the PDF called Emulator Ground Plane.pdf at Vuforia|Databases|ForPrint|Emulator from the Project window. Print it and place it on the ground (you can also open the PDF image directly on the computer, although the size reference might not be accurate).
  2. Press the play button in the top Toolbar and point the webcam to the image. You will see a visual mark when the software detects a surface (the target, in this case). Before pressing the play button, you can click the Maximize on Play button in the Game view's top-right corner to see the image maximized on the screen:

 Game view detecting the Ground Plane Emulator image
  1. Click on the computer screen over the Game view to simulate a screen touch on the phone. The cube will appear over the target. Its size will depend on the size that you gave previously in the Unity editor (the Ground Plane Stage in Unity is 100 cm x 100 cm, while the printed emulator is 20 cm x 20 cm): 

The cube appears on the floor when clicking the Game view

If everything works as expected, we can change the cube and start shaping our AR app to show furniture in the real world.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.122.162