What is augmented reality (AR)? AR is a technology that places information such as images and text into the physical world we see. Typically, this is done through a camera that acts as the application’s “eye” and lets it see the world. This is not to be confused with virtual reality (VR), where an application creates a digital environment of its own that the user can interact with using special hardware. From there, the app can project objects into the world for the user to interact with or do something if it finds a specified real-world object. Though AR may sound like science fiction, it is a technology that has existed in some form since the 1990s. Most people probably think of popular mobile games when this technology is brought up, but it has application in archaeology, education, marketing, and more.

There is much that can be done with AR, so this project aims to provide an introduction to AR development by sampling the functionality available to a developer in an app made with Unity and Vuforia, a software development kit (SDK) for AR. The app will perform three tasks: first, it will recognize certain objects and images in the real world and spawn a game object upon finding the real-world item. You’ll be able to interact with this object by tapping on it, and the app will recognize when your device is near the spawned object. Finally, a simple graphical user interface (GUI) will be made to demonstrate how the typical Unity features a developer uses works just as well in an AR application.

starting Unity project is provided to help you jump right into AR development. In addition, a completed version is available to compare to your own as well as experiment with freely.

Template Overview

The codeless template provides all the assets that are used in this example, including the image file for the playing card used. You can, of course, use your own image target if you wish, but keep in mind that some of your scale and width values will likely differ from what’s shown here. All that remains to be set up in this project is the AR configuration and the scripts. Within the _Assets _window are several other folders, each containing the types of assets specified. Feel free to browse them if you wish, but they will not be looked at in any detail during the tutorial. It bears mentioning that the textures were provided by CC0 textures, which can be seen here.

Within the scene, are some buttons and text along with a chest. The chest is the object that will appear whenever the app locates a real-world queen of hearts playing card. It’s incredibly small, and that’s because the image target object that will be created later is also quite small. This is to reflect the real-world size of the card. If you were to leave the chest’s scale at the default value of one, it would appear incredibly large in the app once the playing card was found. With this adjustment, it will appear as though it is roughly the same size as the card.

Vuforia Setup

As mentioned above, Vuforia is an SDK for creating AR applications on mobile devices. It allows the application to detect real-world objects. The developer creates a database of “image targets” that will be fed into the Unity app. These image targets are, as you may have guessed, 2D images of what to look for in the real world.

To begin, you’ll first need a developer account on the Vuforia developer portal. You can register the account here. After you’ve created the account and confirmed it, you’ll find yourself at the License Manager screen in the portal. In the top left portion of the screen, there are two buttons, one for gaining a development key and one for purchasing a deployment key. The deployment key is what is needed if you ever decide to publish an AR app with Vuforia, so it can be ignored. Instead, click the _Get Development Key _button shown in Figure 1.

Figure 1: Getting a development key

In the next screen, you’ll assign a name to the license, then simply check the terms and conditions box, followed by clicking the _Confirm _button near the bottom shown in Figure 2.

#c# programming #homepage #sql prompt #c++

Unity and Augmented Reality - Simple Talk
1.30 GEEK