Become Tony Stark: Mobile Virtual Reality Setup With Leap Motion

by TheEpicIronman in Craft > Digital Graphics

13706 Views, 155 Favorites, 0 Comments

Become Tony Stark: Mobile Virtual Reality Setup With Leap Motion

20160502_200207.jpg
20160429_132012.jpg
Instructables Video: Leap Motion VR

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!

Gathering Information on VR and Leap Motion

51c471f3ce395f7f72000000.jpg
51c471f2ce395f1775000000.jpg
71rFofi+B2L._SX522_.jpg
572c386b15be4d18dd00079b.jpeg

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.

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.

Gather the Parts

leap-motion-controller.png
41ossTm7P2L._SY300_.jpg
fb8a7a2b-0594-46d6-bd0c-9e892565debb.jpg._CB310566791__SR300,300_.jpg
one-cardboard.png
flashmob-2000-mah-credit-card-power-bank-white-.jpg

Here are all the parts you will need to find or buy. Click the link for the part I bought!


VR Hardware

You will also need an android phone that is large enough to make the virtual experience a good one.

Hello World!

Start.PNG
StartEdit.PNG
1.PNG
1Edit.PNG
2.PNG
3.PNG

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!

Adding the Assets to the Scene

4.PNG
5.PNG
5Edit.PNG
6.PNG
6Edit.PNG

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.

NOTE:

You need to contact the developers to receive the Leap Motion for android SDK until its public release. You can contact them at developers@leapmotion.com 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.

Opening Leap Demo Scene

7.PNG
8.PNG
9.PNG
10.PNG
10Edit.PNG
12.PNG

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.

Create Scene With VR

13.PNG
14.PNG
15.PNG
16.PNG
17.PNG
18.PNG

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.

Importing the Standard Assets

19.PNG
19Edit.PNG
20.PNG
20Edit.PNG

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.

Adding the FPS Controller to Character

21.PNG
22.PNG
23.PNG
24.PNG
25.PNG

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.

Putting All the Parts Together

26.PNG
27.PNG
28.PNG
29.PNG

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.

Test and Move LMHeadMountedRig Forward

30.PNG
31.PNG
32.PNG
33.PNG

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.

Create Terrain

34.PNG
35.PNG
36.PNG

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.

Build Project

37.PNG
39.PNG
40.PNG
41.PNG
41Edit.PNG
38.PNG

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.

Run Leap Daemon

Screenshot_2016-05-09-17-51-01[1].png

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.

Test the LeapMotion on Android

Screenshot_2016-05-09-17-51-55[1].png

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.

Plug Leap Motion In

20160501_124132.jpg
20160501_124149.jpg
20160501_124202.jpg
20160501_125826.jpg
20160501_125817.jpg

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.

Finishing Up!

Test1.PNG
Test2.PNG
20160502_200156.jpg

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!

Sam