Introduction: Become Tony Stark: Mobile Virtual Reality Setup With Leap Motion
How many of you have wanted to use your hands and look around naturally without having to use your mouse, keyboard, and screen? Well, today I will show you how to use a phone, leap motion, and Virtual Reality goggles to create your very own world.
Why Leap Motion?
Leap Motion is a sensor that can detect hands and output data for us to use! It uses a variety of sensors including cameras and infrared sensors to sense where your hands are withing its wide sensing angle. This project will be using
How Did I Get The Idea?
How many of you out there have once in you life just wanted to be alone and in you own imaginative world? I definitely have, but what if you could virtually be in your world running around building and having fun? I decided to do this project because these types of challenging projects are the ones that I can think and that makes me happy. The spark of this idea was on Christmas day where I had received a virtual reality phone holder that can project a virtual world. At first it was fun to ride in roller coasters and look around. However after a week, I became bored of this headset. I decided I was going to use it to make something extraordinary that has never been done before. Doing the Impossible.
Check Out Video Tutorial!!
If you don't like reading, feel free to watch my detailed video about this instructable. It covers up to saving the file to your phone.
If you want, you can subscribe to me at ThatTechBoy. Also, don't forget to vote! Thanks!
Step 1: Gathering Information on VR and Leap Motion
The Leap Motion has a variety of parts including cameras and infrared sensors.
The Oculus Rift consists of a board, Screen(Note 3) and a few extra gizmos.
Step 2: Installing Unity
You can install Unity from the website HERE. It will bring you to the download page where you can select you operating system and install the program. You will also need Android SDK but not android studio (bottom of page) which you can get from HERE or in the description. This enables you to create "name.apk" files which is what the android phone needs to install apps. You will also need to go to the Leap Motion website and install the Orion software if you are on Windows and the normal version for the Mac and Linux. Lastly, You will need to install JDK which means java development kit which you can download HERE. It lets you be able to do 3D graphics and most devices in the world run based on Java.
Step 3: Gather the Parts
Here are all the parts you will need to find or buy. Click the link for the part I bought!
- Leap Motion - $29.00
- Powered Micro USB OTG cable - $1.69
- IncrediSonic VR Glasses Virtual Reality Headset & Bluetooth Controller - $39.95
- You can buy Google Cardboard instead - $5.99
- 2000MaH Battery - $5.99
You will also need an android phone that is large enough to make the virtual experience a good one.
Step 4: Hello World!
In the programming world, first thing you do is to create a simple program called Hello World! However today we will be starting a new project in Unity. First what you want to do, is press new at the top right corner of the page. Then you can name it whatever you want. Make sure 3D is pink to create a 3D world. Your on your way to a journey of a lifetime!
Step 5: Adding the Assets to the Scene
Without add-ons to our world, you wont be able to do anything except stare into the darkness. We need to add assets for the Leap Motion and for the VR. With the assets here, you need to drag them in from your desktop or folder in to the bottom portion of the screen. It will load and show you a screen. Press All and then press Import. Repeat this for both assets.
You need to contact the developers to receive the Leap Motion for android SDK until its public release. You can contact them at firstname.lastname@example.org or you can wait and fill this form out to receive it the second it is released.
However, you can download the Orion Leap asset in place but it will not work just connected to the phone.
Step 6: Opening Leap Demo Scene
First, you want to navigate through the files at the bottom and select LeapMotion/Scenes and then you want to pick the Head Mounted Demo. Once you open up the scene, it will take a few seconds to load. Then you want to select LMHeadMountedRig, right click, and copy the object.
Step 7: Create Scene With VR
First, you will want to right click in the side and paste the object copied. Then you want to go to the bottom with the files. Select the Cardboard folder then the Prefabs folder. You will want to drag CardboardMain into the sidebar.
Step 8: Importing the Standard Assets
You will need to import the standard assets which have some prefabs to make the character be able to move. At the top, you will need to go to Assets/Import Asset, and select the characters.
Step 9: Adding the FPS Controller to Character
Once it is finished loading after you imported the Characters, you will need to go to Standard Assets/Characters/FirstPerson. Then take the FPS controller and drag it to the side.
Step 10: Putting All the Parts Together
First, you want to open the FPSController, then you want to delete the contents in the folder. After, you want to move Cardboard and LMHeadMountedRig into the FPSContoller. You also want to click the LMHeadMountedRig and uncheck the camera on it.
Step 11: Test and Move LMHeadMountedRig Forward
Once you press play at the top, you see a screen split up and a boring dark world. Lets fix this. First you want to move all the objects to 0,0,0. Then you want to move the LMHeadMountedRig forward 0.4 so that when you reach your hands, you can see them.
Step 12: Create Terrain
You can create a terrain so that when you spawn, you can walk around and see you own world. Go to the top and select Game Object/New 3D Object/Terrain. Once you did that, you want to make the coordinates 250,250,250. Then you can mess around with the lift function which can make your terrain unique.
Step 13: Build Project
You are almost there. First you will go to file, build settings. In the settings you will need to change a few things so that the app will work. You want to open Other Settings, then look for the long text (Highlighted above). Then you want to make it so that they match. First you need to change com.Company.ProductName to com.DefaultCompany. whatever you named your project at the beginning without spaces. Then you can build the project and be sure to select android as the platform. After, it will ask for the Android SDK and the JDK so make sure you have those handy. Then you want to move the .APK file on you phone by plugging the phone in, then turning on the phone and unlock if passcode. It should appear on you computer which then you can open the phone folder, then go to DOWNLOADS, then put you .APK file there.
Step 14: Run Leap Daemon
Once on the phone, you will need to have a file explorer such as ES file explorer or if your phone already has one, no need to download. Then go to device storage and again go to the DOWNLOADS folder. Your APK should be there which you can install. After, you will also need to install the LeapDaemon which you can read step 6 to get it. Then the Leap should pop up at the top.
Step 15: Test the LeapMotion on Android
You can now test with a test app from the developers or you can try your own. Note that the phone has a slower processor than an average computer, meaning that the response time will be slower.
Step 16: Plug Leap Motion In
You can plug the Leap Motion in and see the magic happen! Even if you phone is not USB3 like the Leap is, it will still work.
Step 17: Finishing Up!
Ahh. Finally! What a day! you have created your own virtual world that you can use your hands and move in! How cool is that! Now you can show your friends and recieve the ooohs and aaahs from them! Thanks for reading!
We have a be nice policy.
Please be positive and constructive.
Excuse me, where can I get Leap Daemon?