NOTE: All files will be located in the Course Google Drive
Requirements:
Unity
Android Studio (If building for Android)
Access Google Drive for extra files.
Printed out images located in Google Drive
Note: Please ask questions over slack.
Vuforia is an Augmented Reality Software Development Kit (SDK) for all mobile devices that allows for quick and easy creation of Augmented Reality applications. It uses computer vision techniques to recognize and track images and simple 3D objects, such as figures, in real-time. The SDK supports a variety of 2D and 3D target types.
Since Vuforia is able to work on all devices, it is a quick and easy way to create VR applications. In this tutorial, we are going to make something inspired by the Harry Potter world, the moving news paper.
In the film, Harry picks up a news paper and is immediately captivated by the moving images on the news paper showing the recent events. We can emulate something like this in Unity using Vuforia. Here is a video if you are curious what this will look like. and you have never seen the films
Create Account:
Go to Vuforia Developer Portal, sign up, and verify your email.
Tip: Use a non-expiring email for long-term project access.
License Key:
In the License Manager, create a Development Key named VideoPlaybackAR.
Copy the key (you’ll add it to Unity later).
Image Target Database:
In Target Manager, create a database named VideoPlayback.
Add the Deathly Hallows image (from Google Drive) as a target:
Width: 500 (ensure the image is high-contrast and unblurred).
Download the database as a Unity Editor Package (VideoPlayback.unitypackage).
Install Unity:
Use Unity Hub to install Unity 2021 LTS or newer.
Critical: Check Vuforia AR Support during installation (required for AR features).
Create Project:
Name: HallowsAR, Template: 3D Core.
Enable Vuforia post-creation (if missed during install):
Go to Edit > Project Settings > XR Plug-in Management > Enable Vuforia.
Import Vuforia Samples:
Asset Store: Search for Vuforia Core Samples, download, and import into your project.
Note: When prompted about overwriting, select "Don’t Ask Again" unless you have existing data.
Add License Key:
Navigate to Assets/Vuforia/Configuration.
Select VuforiaConfiguration.
Paste your Development License Key into the App License Key field.
Import Image Target Database:
Drag the downloaded VideoPlayback.unitypackage into Unity.
In Vuforia Configuration, under Databases, ensure VideoPlayback is checked to activate it.
Open Sample Scene:
Navigate to SampleResources/Scenes and open ImageTargets.
Duplicate Image Target:
In the Hierarchy, right-click ImageTarget_Fissure > Duplicate.
Rename the duplicate to ImageTarget_Hallows.
Adjust Transform Position to (0.4, 0, 0) to prevent overlap.
Replace Video:
Download the Harry Potter video from Google Drive (ensure it’s in .mp4 format).
Drag the video into Assets/SampleResources/SceneAssets/ImageTargets/Video.
In the Hierarchy, select ImageTarget_Hallows > Video.
In the Video Playback component:
Replace Fissure video with your Harry Potter video.
Set Rotation to 180 (fixes upside-down playback).
Assign Hallows Image:
In ImageTarget_Hallows inspector:
Under Image Target Behaviour, set Database to VideoPlayback.
Set Image Target to Hallows_scaled (from your imported database).
Adjust Scale to 0.12065 (prevoversized rendering).
Fix Material (Optional):
If the target image appears distorted:
Navigate to Assets/Editor/Vuforia/ImageTarget/Textures.
Assign the Hallows image to the target’s material.
Webcam Test:
Press Play.
Print the Hallows image (from Google Drive) or display it on a screen.
Point your webcam at the image. The video should play automatically.
Troubleshooting:
No Video? Check:
Video component references.
Vuforia license key validity.
Webcam permissions in Unity (Edit > Project Settings > Player > Webcam).
Android Studio Setup:
Install Android Studio and SDK/NDK via Unity Hub:
Unity > Edit > Preferences > External Tools > Configure SDK/NDK paths.
Player Settings:
File > Build Settings > Switch Platform to Android.
Player Settings > Other Settings:
Color Space: Gamma (required for Vuforia).
Minimum API Level: 24 (Android 7.0).
Write Permission: Enable External (SDCard) if saving files.
Build & Run:
Connect an Android device via USB (enable Developer Mode).
Click Build and Run. Test with the printed Hallows image!
Video Alignment: Adjust the video’s Transform Position/Scale in the Hierarchy for perfect overlay.
Multiple Targets: Add more videos by duplicating ImageTarget_Hallows and assigning new images/videos.
Lighting: Ensure the target image is well-lit for reliable tracking.