Sunday, August 17, 2014

Using Leap with the Free version of Unity 3d

When I started trying to play with Leap and Unity, I found that the asset package for Leap on Unity's online store had a version that required Unity Pro. The error you get when trying out the tutorial on Leap's Youtube video (embedded below) when using free Unity is that when you try to play with Leap's Hand Controllers on , you get something to the effect of "This plugin requires Unity Pro."


Now, Leap's website clearly states that a package for free Unity existed (which is what I downloaded.) Unfortunately, there did not seem to be any asset bundle in that zip file. So there wasn't a clear way to import the contents of that package into Unity. That left me rather confused, as I was new to Unity and still a relative Leap newbie.

After Googling for the solution it appears that the Leap Devs had documented this but did not make it very accessible. The instructions are here:

https://developer.leapmotion.com/getting-started/unity/free

There are some minor sources of confusion in the instructions however. The instructions were for the context of taking their Unity examples, and modifying them so they would work for free Unity. I was starting from a Unity project from scratch using the Youtube tutorial above. Their instructions for starting from scratch were based only on Windows folder structure. For the Mac, the files libLeap.dylib and libLeapCSharp.dylib were found in the LeapSDK/lib folder instead. This instruction probably was not completely necessary, as the subsequent commandline instructions on the same page showed how to get those files from deeper in the Unity project's folder structure not previously documented.

In any event, I got my Leap device integrated with the free version of Unity rather quickly after that. Here is a screenshot of me playing with a bouncing ball, a bouncing cube, and a gravity-tied box I could pick up and throw inside Leap's prefab bounding box. You need to get the camera within the box, as well as the directional light source. The above Youtube video covers instructions for setting the properties of some of the objects.


Some initial experiences - the hand control seemed clunky, and the lack of stereo vision on the 2D screen meant I had some difficulty reaching out to the right depth. The fingers of the default hand avatars had a lot of difficulty gripping stuff, even though the small block was supposed to be made of "rubber". It is not certain to me if my Leap hardware is old or not as good as it should be. Of course, with regard to grip and all other aspects of Unity interface, I am sure it is down to getting the physics configured just right or building a new hand model that works better than Leap's prefab hand. One thing the interface is pretty good at is bouncing a free floating ball inside an enclosed box, especially if one makes a fist.

Saturday, August 16, 2014

install_name_tool on Mac OS X

Full notes here on my technical blog:
 
Wished I had known this earlier when working with Leap SDK 1.2. Also means I won't have to worry about getting development work on Leap SDK 2.1-beta done with Cmake unless I really want to play around with both.

A Quick Update

It has been a while since I've done anything for the Leap device I have. It really has been a whole host of personal issues that kept me away. I think it mostly stemmed from the frustration of having to deal with the Xcode development environment which was not familiar to me, and for which I was (and still am a little) hesitant to dive deeply into. There were also other frustrations with the Leap API - back then, you had to implement your own code for determining which pointing objects were what whenever they went out of the device's tracking range. Also other than simply measuring my fingers, I really didn't have much of an idea of anything cool and fun I could work on. I still do not. Finally, I've been fighting a number of physical and emotional issues the past few months, including a debilitating skin eczema that still afflicts me now. So I am hardly focused on any one thing right now.

Meanwhile, the Leap SDK had grown significantly, and in pretty exciting ways. The language support has improved, and I'm particularly excited about the new way they allowed the Leap device to be used with javascript, and the Unity 3D development engine.



So I'll continue to casually play around with the new SDK, and think about what I'd like to do with it. I had been wanting to mess around with Unity 3D for a while now, so this might be a good chance to do both.

Edit: I'd also like to add that the reason I felt interested to try to play around with Leap development again was my discovery of Kitware's Cmake build features, which could help me work around a development environment's (like Xcode's) idiosyncrasies I am unfamiliar with, and just focus on the code.