Meta have been in the news recently after a much anticipated TED talk last week showcasing their next augmented reality headset, the Meta 2. This was fantastic timing for my first article on developing for the Meta augmented reality headset in Unity! If you have one of the original Meta headsets and you've been putting off building AR apps — now is a good time to dust that headset off and do some development!
In this tutorial, we will look at creating an augmented reality butterfly experience. We will be starting from the basics and will finish with a simple butterfly we can grab and move around our scene.
What You'll Need
In order to follow along with this tutorial, you will need the following:
- A Meta 1 Developer Kit - These are sold out, so if you aren't lucky enough to have one, you'll need to find a friend who owns one or wait for the Meta 2!
- Unity 5.2.1 (32 bit) or Unity 5.2.2 (64 bit) - Meta support for Unity 4 is ending soon, so it is best to get up to Unity 5 by this point! I'd recommend downloading via Meta's links which we'll cover below.
- Windows 8.1 or Windows 10 - Sadly Mac OSX isn't supported and Windows 7 support is being phased out.
Downloading Unity and the Meta SDK
The safest way to get the right versions of both Unity and the Meta SDK is to head to the Meta Dev Center. From here, you can download the latest Meta SDK:
Once that has downloaded (or do this simultaneously if you've got much faster Internet than I do!), scroll down to download either the 64 bit or 32 bit Unity depending on your operating system:
Once Unity has downloaded, run through the install process for both the Meta SDK and Unity. Both are pretty straightforward, so I won't waste time discussing them here! Once both have installed, open up Unity and we will get started!
Creating Our First Project
When we first open up Unity, the welcome screen has an option for starting a new project in the top right. Click "New" to start a new project:
Then, we name our project (you can call yours whatever you'd prefer, we've gone with "Pretty Butterfly") and choose where you'd like it saved on your computer. Make sure you have 3D chosen on the bottom left! When ready, click "Create Project":
Before doing anything else, it can be a good idea to have your initial scene named and saved. To do so, go to File > Save Scene as....
We add a new folder for our scenes within the project's "Assets" folder called "Scenes":
Then name our scene "ButterflyScene" — you can name yours whatever you'd like!
Importing the Meta SDK
Now that we have a scene saved and ready, it is time to import in the Meta SDK we downloaded earlier. To do this, we click Assets > Import Package > Custom Package...:
Navigate through your filesystem to the Meta SDK. For me, this was in C:/Program Files (x86)/Meta/Meta SDK. In this folder, we choose the "Meta" Unity package:
After a bit of loading time, a window with all of the Meta SDK assets found will appear. Ensure everything is checked and click "Import":
If Unity pops up saying "This project contains scripts and/or assemblies that use obsolete APIs", that's okay. Just click "I Made a Backup. Go Ahead!"
We should now see two new folders, "Meta" and "MetaPackage", within our project:
Adding MetaWorld Into Our Project
Within our new assets, we have our "MetaWorld" Prefab that will give us all of the Meta camera and interaction functionality we need. If you are new to Unity — Prefabs are basically like template objects that can be reused in multiple projects and scenes to share functionality.
The easiest way to add this into our scene is to search within the "Project" window. Type in "MetaWorld" and it should filter our assets to show us what we want. Drag the "MetaWorld" prefab into your project hierarchy (where you've currently got a "Main Camera" and "Directional Light"):
The actual location of the "MetaWorld" prefab for those wondering is Meta/MetaCore/Resources/Prefabs/MetaWorld.prefab.
Continue reading %Getting Started with Augmented Reality and Meta%
by Patrick Catanzariti via SitePoint
No comments:
Post a Comment