I am lucky enough to have been accepted into the Leap Developer Program. If you do no know what the Leap is, then check out www.leapmotion.com
I have some ideas as to how to use this interface (definitely not as replacement to a touch screen, but something that can use the 3rd dimension since it has “depth”) Anyway, in order to experiment, I decided to experiment using a gaming engine and settled on unity3d (www.unity3d.com) as it seems to be quite well supported.
Here started my dilemma Unity3D has 2 versions, a free one (for companies making less than 100K a year and with some limitations) and a Pro one (quite reasonable price, 1.5K). But, to just experiment, I wanted to use the Free one and not have to shell out 1.5K.
The problem is that in the Free version of Unity, you are not allowed to use a native DLL (you can however use .net managed DLLs).
So, with Leap supporting C# and .net, I thought it would be quite simple to get the free version working… and indeed it was… But, noone seems to have blogged the exact steps, and all posts I have seen, just hint that this is possible without the actual step by steps to how to do it.
Hence… (Drum Roll please)… below are the step by step introductions on how I got it working (really simple after all).
1st, I am running Windows 7, 64Bit and version 0.74 of the SDK (downloaded this morning)
Step 1 – Make sure you have a Leap, and have downloaded the SDK and your leap is working – Run the Leap Visualizer to make sure that the leap is working well.
Step 2 – Locate the Unity Assets folder. This is located under [SDK Path]\LeapSDK\lib\UnityAssets\Plugins (there are 3 files there – Leap.dll, LeapCShare.dll and LeapCSharp.NET3.5.dll
Step 3 – Locate and make a copy of the Unity Sandbox folder. [SDK Path]\LeapSDK\Examples\UnitySandbox
Step 4 – Copy the Unity Sandbox folder somewhere else, where we will experiment. I called mine UnityFreeSandbox
Step 5 – Run the UnitySandbox.exe already built under the UnitySandbox folder. It should run and you show be able to use your leap to interact with the Cube (note the picture below showing that it can detect by finger).
Step 6 – Now, open the UnitySandbox project within Unity itself. (in UniySandbox folder, Go to subfolder Assets\Scenes folder and open UnitySandbox scene).
Step 7 – Now inside Unity Editor, run the program. You will note that it will work, but you will get errors logged in the console “License error – plugins are only supported in Unity Pro” (see screen shot below)
Step 8 – Now, within the Unity Editor… Go to Assets\Plugins and you should see 3 files (Leap.dll, LeapCShare.dll and LeapCSharp.NET3.5.dll). DELETE the 1st 2, so you are only left with LeapCSharp.NET3.5.dll there).
Step 9 – Run the program within Unity and you will note that it will NOT work and the console shows an error (see below)
Step 10 – Now copy 2 of the 3 files from UnityAssets folder (see step 2) [SDK Path]\LeapSDK\lib\UnityAssets\Plugins , namely, Leap.dll and LeapCShare.dll to the root folder where you copied UnitySandbox – See Step 4 (I called mine UnityFreeSandbox)
Step 11 – Run your project and you should see that it runs, and works with no errors in the console.
Step 12 – Build your project and create an EXE, if you place it in the root folder UnityFreeSandbox where your dlls are, it will work with no problems. If you want to deploy it, you will need to ensure that the 2 Dlls copied in Step 10 are deployed with your EXE (in the same folder would be my choice)
Step 13 – Enjoy and let me know how you get on with Leap and Unity.