Augmented Reality (AR) has a promising future for various markets, in this case a medical application has been found, focused on treating chronic pain, which is a very complex condition experienced in a wide range of feelings. In order to communicate these characteristics easier to the therapist's, a AR application has been taught to share the pain experienced in real time, by shaping and modifying it until gets as close as possible to the actual feeling.
Step 1: Download the Software, Make a Couple of Accounts...
In order to test this principle, we are gonna use Unity, now integrated with Vuforia plug-in, which allows making AR applications.
Go and download Unity (Personal Free Version https://store.unity.com/download?ref=personal)
Also will need to make an account for Vuforia as "Developer" (https://developer.vuforia.com/vui/auth/register)
Step 2: Create Key and Copy to Clipboard
In the Vuforia Developer website, go to "Develop" tab and create a Key. Click on the key once created and copy the code to your clipboard.
Step 3: Create a Database and Add a Trackable Image
Now click on the second sub-tab "Target Manager". Here you will create a Database first. Once created, click on it and you will be able to add targets.
Targets can be 2D images, as they can also be cuboids, cylinders and 3D objects. For this application, a 3D scan of a body part will be uploaded, so the patient can directly use the application on itself. But first, the principle will be proven and therefore a simple line-art image will be used. Here you can download it Trackable image.
Then add the file, put just "1" into With, and name it whatever you like. Click on Add, and finally Download Database.
In case you want to use a different image, it is recommended to go into Vuforia Optimizing Target Detection and Tracking Stability page, so you can have an idea of what kind of images you should be using.
Step 4: Start a Unity Scene
Now it is time to actually do the application inside Unity software. Open a new scene, and then delete the "Main Camera" and the "Directional Light" that appear for default. Now go to Edit / Project Settings / Player, and click on the last option that appears on the right panel (Vuforia Augmented Reality).
After this right click on the left panel and look for Vuforia / AR Camera, and click on it.
Lastly, on Window tab / Vuforia Configuration, and in the right panel, paste the license key we previously copied to the clipboard.
Step 5: Set the Trackable Image
Then, import the database containing the trackable image. On the lower panel, select the "Assets" folder and we are going to right click and look for "Import Package" and then click on "Custom Package". Look for the package you previously download and click on Open.
After this, go to the left panel (Create) and right click and look for Vuforia / Image. Is recommended to scale it first to "1" inside the Transform options, on the right panel (Inspector). Then go to the "Image Target Behaviour (Script)" options and on "Database" select the database you imported. If you only have one image, the Image target option below will already be selected as well.
Step 6: Import Assets
Now, hit the button Asset Store. In this store, you can find all kinds of elements that can be integrated into Unity, from 3D models to Animations, Audio and Codes.
Look for "Lean Touch", a group of codes that are used to interact in unity with the mouse or a touchscreen. Click on import.
Secondly, type "TinyFire VFX 1.0" , a package of fire-style animations that will be placed on the hand image. Click on import.
Go back to the Scene (Click on Scene tab), and on the lower panel clock on Assets / TinyFire VFX / Prefabs / TiniFire and choose any of those. Grab it and put it on top of the "ImageTarget" on the left (create) tab.
FInally, go back to the Assets folder and look for Assets / LeanTouch / Examples / Scripts and grab the "LeanTranslate" and drop it on top of the TinyFire on the left panel.
This step shows how we can take advantage of what is already there and save some time.
Step 7: Test the Scene!
Finally, now everything is set, is the moment to push the play button and see how it works. Go and print the image so you can test the application.
Push the Play button on top of the Scene. It may delay a little to recognize the image at the beginning, therefore is recommended to hide the image (by just flip it or take it out of the camera) and show it again. Once the animation is on the image, you can and move it with the mouse, locating it wherever you want.